The story of Oedipus begins with an appointment with the Oracle of Delphi. The future biological parents of Oedipus (Jocaste and Laïos, Queen and King of Thebes) learn that, if they have a son, he would kill his father (alias Laïos) and marry his mother (alias Jocaste).
You should know that making appointments for the oracle (judgment of the god Apollo with an assistant drugged with herbs called Pythia) is a bit like with the ophthalmologist these days, it is rare and precious. The review is quite short but the verdict is often right (when Apollo is willing to answer).
That said, our happy little ones return home and Jocaste becomes pregnant. The couple trusts the judgment and abandons the baby on Mount Cithéron by piercing the ankles of the baby (well, yes, how do you hang the baby on the tree otherwise?). This is what earned him his little name of Oedipus (swollen feet in Greek).
But the baby is saved by Polybius and Merope (king and queen of Corinth), who adopt and quietly raise him.
Years go by ... and ... at one point, at a dinner, it seems that someone is telling Oedipus that he is an illegitimate son ... Doubt then lives in our protagonist and he decides to go and consult the oracle to find out who his true parents are. The god, a little teasing, does not tell him who his parents are but gives him a little clue that he is going to kill his father and marry his mother… Oedipus, thinking that his parents are Polybius and Merope (while not at all!, well yes, they are ... but not biologically anyway), he does not return to Corinth for fear of hurting them and that the prophecy will not be fulfilled.
On the way, he comes across an old man on a chariot that gets him drunk because he is grilling the priority on the right. The situation gets a little worse and Oedipus kills him (no luck it's Laïos, his biological father, but he doesn't know that, hehe).
Oedipus gets closer to Thebes and comes across a Sphinx who terrorizes the city and devours the travelers. To overcome it, it is "enough" to solve its enigma: "Which being has four legs in the morning, two at noon and three in the evening?". Oedipus finds the answer (the human), thus saves the city and becomes the king of Thebes. He then married the widowed queen of the kingdom, alias Jocaste, his mother. Well then after this ... He believes that she is a woman like the others so ... And then for Jocaste, he is cute this little one, he reminds him a little of her husband ...
Oedipus, after having children with his mother, investigates the murder of Laïos, the former king. He then discovers that he is his father. He raises his eyes not to see his crimes and goes into exile. Jocasta, on the other hand, hangs herself when she learns all that. End.
Why so much hate? I don’t know but apparently it’s because Laïos had done uncool things in his life before. So be nice, it's better.
The Oedipus complex in psychoanalysis
Armed with this history, Sigmund Freud theorizes the Oedipus complex (or Oedipus) which is defined as the unconscious desire to maintain a sexual relation with the parent of the opposite sex (incest) and that to eliminate the rival parent of the same sex (patricide or matricide).
PS: if you want other puzzles like the Sphinx, you can take a look at this article on the puzzle cellar.