Many animals can swim. Probably people have always been able to swim too. The very earliest human people lived along the seacoast in Africa, and gathered shells from the ocean, so they would have needed to swim. Certainly by 8000 BC African people were swimming, as we can see in this painting from Gilf Kebir in the Sahara Desert (which had rivers in it then!).
At least one group of African people who left Africa and traveled all over the world brought their swimming strokes with them. Some of the earliest Africans traveled along the coast to Yemen, then to south India, and from there to Indonesia and Australia. The people in all of these places are good swimmers. In India about 300 BC, the Ramayana mentions a swimming pool. People also swam in China, where an early Chinese character shows a person swimming, and in the Americas.
A second group of travelers leaving Africa seems not to have known how to swim, though, or they soon forgot how. These people headed north, and settled in Central Asia, West Asia, and Europe, where people have always been much less enthusiastic about swimming. These Assyrian swimmers from 860 BC had leather bags made from goat-skins that they blew up like balloons to help them float! Persians also apparently did not generally know how to swim: this is why the Persian men fighting the battle of Salamis died when their ships sank.
By the time of Ancient Greece, where fishing and sailing were very important, both boys and girls had learned how to swim and dive well – maybe from the Carthaginians. According to the Odyssey, the hero Odysseus knew how to swim to shore when he was shipwrecked.
“Take off these clothes, and let the wind take your raft, while you swim hard towards the Phaeacian coast… Then he … arms outstretched plunged into the sea, ready to swim… Looking ahead as a long wave suddenly lifted him, he saw the shore nearby… He swam on, eager to reach solid ground. … he clung to a rock with both hands, and hung there, groaning, until the wave had passed.
So he survived, but with its backflow the wave caught him again, and took him, and drove him far out to sea. Just as pebbles stick to an octopus’ suckers when it is dragged from its crevice, so pieces of skin stripped from his sturdy hands stuck to the rock, and the wave swallowed him. Then poor Odysseus would surely have died, if bright-eyed Athena had not sharpened his wits.
Freeing himself from the surf breaking on shore, he swam outside it, staring towards the land, hoping to find a shelving beach or a natural harbor. Then, swimming, he came to the mouth of a fast river that seemed like a good place, free of stones, and sheltered from the wind… so bringing him safely to the river mouth. His knees gave way, and his arms fell limp, his strength exhausted by the sea. All his flesh was swollen, and streams of salt water oozed from his mouth and nose. So he lay there, breathless, speechless, with barely enough energy to move.” (Odyssey, Book 5)
On the Francois vase, about 570 BC, one of Theseus‘ men jumps from the ship into the ocean to swim to shore with a good crawl stroke. Some people dove from high diving platforms (in those days everybody swam naked). About the same time, Etruscan boys were also good divers, as a fresco from an Etruscan tomb shows – and Etruscan boys swam in the ocean. People also swam all over the Roman Empire. Julius Caesar, for example, was a good swimmer. But no European swimmers could swim as well as most African, East Asian, or Native American people.