@jp is right… IPv6 will handle that situation when it comes to unique machines connected directly to the Internet.
Most computing devices are not connected directly though. They connect to a subnet instead.
So, IBM for example, might have a single IP address for its proxy gateway on the Internet. Behind that proxy could be literally millions more devices with unique IP addresses within that subnet. (IBM actually has a rather large block, but my example is still valid).
Those subnet IP addresses might employ duplicate numbers as what’s on the Internet itself, but that doesn’t matter as the subnet mask is part of the mechanism to keep things separate.
—
For example, suppose a home network consists of computers named Foo and Bar, connected to a router, and then via a cable modem to the Internet. The home network is configured as a subnet. Address 17.76.99.1 is assigned to Foo, and 17.76.99.2 to Bar. The subnet has been configured so that the first three octets of its members’ addresses are all the same subnet id, 17.76.99, and this fact is expressed by the subnet mask 255.255.255.0 (binary 11111111 11111111 11111111 00000000) configured in the router. When Foo sends data to http://amazon.com at 72.21.210.11, the router performs a logical AND of the address with the subnet mask, recognizes that the first three octets of the address are not within its subnet, and therefore sends the data over the Internet, via the subnet’s default gateway. When Foo sends data to Bar, however, it determines that the destination lies within the subnet and the default gateway is not required. The data is transmitted directly from Foo to Bar within the home network.