The tragic downfall of Oedipus in Sophocles's Oedipus Rex is Oedipus's belief, based on his overwhelming pride (what the ancient Greeks called hubris),that by exercising his own free will, he can thwart the will of the gods and choose his own destiny.
Everything that the gods preordained would happen to Oedipus happened long before the play begins.The gods determined that Oedipus would kill his own father. He did. The gods further determined that Oedipus would marry his own mother. He did.
Oedipus unknowingly killed his own father, Laius, on his way to Thebes from Delphi, where Oedipus learned from the oracle that he was destined to kill his father and marry his mother. As fate would have it, Laius was on his way to Delphi to inquire about omens foreshadowing his death.
After he killed Laius, Oedipus continued to Thebes, where he solved the riddle of the Sphinx, for which he was awarded the throne of Thebes and marriage to Queen Jocasta, who Oedipus didn't know was his own mother.
There's nothing that Oedipus can do to change these events. Oedipus and everyone involved with Oedipus's life brought these events about by attempting to circumvent the will of the gods, either unknowingly or by pridefully exercising what they believe is their free will.
The only things left for Oedipus to do in Oedipus Rex are to discover his tragic flaw that influenced his own choices, to learn about choices made on his behalf that led him to this point in his life, and to suffer the fate that the gods have decided to impose on him for the defiance of their will.
To force the issue, the gods bring a plague and famine on Thebes and give word through the oracle that the plague and famine are a result of Laius's murderer still living among the people of Thebes. Oedipus, the self-proclaimed "world-renowned king," takes upon himself the responsibility of finding Laius's murderer and of applying the appropriate punishment—"Banishment, or the shedding blood for blood"—to appease the gods and relieve the people of Thebes from their suffering.
Oedipus has ample opportunity to display his tragic flaw by defiantly rejecting any suggestion that he himself is Laius's murderer or that he's at fault for any of his own choices to defy the gods.
Ultimately, Oedipus is revealed as Laius's murderer, and he's exposed as a person whose prideful decision to defy the gods on the road from Delphi set in motion the events that led to the fulfillment of the oracle's prophecies and to the suffering of the people of Thebes.
Oedipus administers his own punishment. He blinds himself—"shedding blood for blood"—and banishes himself from Thebes, thereby acceding, finally, to the will of the gods and fulfilling his own destiny.
The lesson of Oedipus's life, as Sophocles presents it to his audience in Oedipus Rex, is voiced by Creon:
CREON. Crave not dominance in all,
For the mastery [pride] that raised thee was thy bane and wrought thy fall.