There's a finite number of shares. You can look up the market capitalization, divide by the price, and get the number of outstanding shares, though it's also a reported statistic on its own.
Correct, but the number of shares outstanding isn't infinite: it's always a fixed number. Just like there's a fixed number of square miles of land. And you can make and remove land. Lots of dredging along coastlines is done to make land. It isn't a great analogy and investment decisions should not be based on the concept.