According to Greek mythology the Sphinx, who was a mythical female monster with the head of a human and the body of a lion, the wings of an eagle and the tail of a snake, sat outside of Thebes, a city near Athens. There she asked this riddle to all travelers who passed by. If the traveler failed to solve the riddle then the Sphinx would kill them.
The riddle was: Which creature walks on four legs in the morning two legs in the afternoon and three legs in the evening?
No one was ever capable of answering correctly. Until one day, Oedipus came along. Oedipus was promised the hand of the princess should he interpret the riddle correctly. As he was famous for his wisdom, Oedipus found the answer to the riddle with ease, replying: "Man, who as a baby crawls on four legs, then walks on two legs as an adult and in old age walks with a cane as his third leg…”
The Sphinx became so frustrated about this answer that it committed suicide immediately, throwing herself from a high rock. Oedipus thereby won the freedom of the Thebans, the kingdom of the city, and a wife, who was later revealed to be his mother.