In Oedipus Rex by Sophocles, the presence of the oracle is in keeping with the elements of Greek tragedies. It reflects the conviction of the Greeks who believed that there were those who could predict the future and/or see truths that no one else could see by communicating with their gods.
The oracles represent unknown knowledge, guidance from the gods...
In order to understand the will of the gods, the Greeks consulted oracles.
Creon has consulted an oracle at Delphi that tells him that the murder of Thebes' former King, Laius (Oedipus' father), was never solved and until it is, the plague tormenting the people will not end.
I shall say all I heard from the god.
Phoebus clearly ordered us, my lord,
to drive out the pollution being fostered
in this very land, not to nurture it unhealed…
By driving a man into exile,
or undoing murder with murder again,
since this blood shakes our city like a storm. (105-108, 111-113)
It is at this point that Oedipus calls for Tiresias. He is a prophet who knows the truth of Oedipus' parentage, which will solve the murder of Laius.
Tiresias, a blind prophet and servant of Apollo, twice was asked by Oedipus to come to the palace...
Had there been no oracle for Creon to consult, neither Creon nor Oedipus would have known the cause of the plague, and would not have looked for Laius' killer. Oedipus would never have realized that he had inadvertently killed his father and married his mother. The plague would not have stopped, it would seem, but Oedipus' tragedy would never have taken place. Life for Oedipus would have been good except for his concern of his people's well-being.