Are all Public addresses connected to each other? Can I ping my friend's public IP address on another side of the world, or are public addresses are divided into groups (something like private and public)? What makes this ping impossible?
Converting comment to an answer.
Public IP addresses are public IP addresses. They are available from any other public IP address across the internet. The only restriction will be if an active host has a firewall or other measures to prevent you from accessing it. Other measures could be a DDoS Filter with Geo blocking, that only allows specific public IP addresses to access its network. Some ISPs and companies use Geo blocking also.
If we define a public address as everything that is not mentioned in RFC5735 the answer is NO.
not all public IP addresses are routed on the Internet. I know at least one customer using a "public" /16 network for internal (server) addressing. The main reason for using these addresses is to make absolutely sure that there is no overlap with RFC1918 addresses used in other parts of the network. An overlap free VPN between different parties is also a good example to use public addresses registered for this purpose.
There might be a firewall / packet filter in the way. E.g. many universities use public IPv4 addresses for each and every host but that does not mean that you can access each and every address from the public Internet (or even the internal network).