What is an example of irony in Oedipus Rex?
Irony is, in fact, a literary technique which originated in Greek tragedy. Most common is dramatic irony in which a character's actions or words are understood by the audience, but unknown to the character.
The drama of Oedipus Rex is based upon the psychological blindness of Oedipus who issues punishments for the murderer of King Laius, who ruled Thebes before King Oedipus. For, he is unknowingly that very murderer who is the cause of the suffering of the people in Thebes.
So, in SCENE I when Oedipus says,
I pray that that man's [the killer of King Laius] life be consumed in evil and wretchedness (234)
Oedipus ironically curses himself. This is an example of dramatic irony, because Oedipus at this point in the drama is unaware of his own guilt and what will become of him.
In another example of dramatic irony from SCENE III, a messenger arrives to inform Oedipus that Polybus "was not your father." For, a shepherd had given the baby Oedipus to this messenger, who in turn gave Oedipus to Polybus. Nevertheless, Oedipus fearlessly replies with great dramatic irony,
Am a child of Luck; I can not be dishonored.
Luck is my mother; the passing month, my brother,
Have seen me rich and poor. (1022-1026)
Of course, Oedipus is, indeed, greatly dishonored and cursed with his own words. And, because he was blind to the truth, he physically blinds and banishes himself.