The Sphinx had been sent by the gods to terrorize Thebes as punishment for Laius' misdeeds. The Sphinx would ask any traveler her riddle, if they answered wrong she would devour them. Oedipus answered it correctly, the first ever.
Your riddle is simple
The Sphinx threw herself off a cliff, ashamed. The people of Thebes were so grateful Oedipus freed them from that monster that since Laius had been mysteriously killed, they made him their king. They also suggested he marry his widow, Jocasta. So the second half of the prophecy had come true.
So, Oedipus and Jocasta begin ruling the kingdom of Thebes together, and that is where the opening of the play begins.