From Wikipedia :
The ship of Theseus, also known as Theseus's paradox, is a thought experiment that raises the question of whether an object which has had all its components replaced remains fundamentally the same object. The paradox is most notably recorded by Plutarch in Life of Theseus from the late 1st century. Plutarch asked whether a ship which was restored by replacing each and every one of its wooden parts, remained the same ship.
The paradox was first raised in Greek legend as reported by Plutarch,
"The ship wherein Theseus and the youth of Athens returned from Crete had thirty oars, and was preserved by the Athenians down even to the time of Demetrius Phalereus, for they took away the old planks as they decayed, putting in new and stronger timber in their place, in so much that this ship became a standing example among the philosophers, for the logical question of things that grow; one side holding that the ship remained the same, and the other contending that it was not the same."
Plutarch thus questions whether the ship would remain the same if it were entirely replaced, piece by piece. Centuries later, the philosopher Thomas Hobbes introduced a further puzzle, wondering: what would happen if the original planks were gathered up after they were replaced, and used to build a second ship.3 Which ship, if either, is the original Ship of Theseus?
Another early variation involves a scenario in which Socrates and Plato exchange the parts of their carriages one by one until, finally, Socrates's carriage is made up of all the parts of Plato's original carriage and vice versa. The question is presented if or when they exchanged their carriages.