Is there a deus ex machina in Sophocles' Oedipus Rex?
This is a great question. It is best to start with a definition of Deus ex machina. Deus ex machina literally means "god out of a machine." However, often it is taken in a figurative way. In other words, there does not necessarily need to be a god that appears to solve things (although this can be the case, as in the tragedies of Euripides). Often it is a literary device that is used to solve a seemingly unsolvable problem. To put it another way, it is when something unexpected is introduced into the play to bring a resolution.
In Sophocles's Oedipus Rex, if there is a deus ex machina, it is found in the character of Tiresias. He is the blind seer that tells Oedipus his real identity. It is fairly dramatic, because although he is blind, he has supernatural sight. Moreover, he comes off with great authority and he is unafraid of Oedipus, even though he is king.
If we do not want to see the appearance of Tiresias, as a deus ex machina, then the tragedy does not have one. This is not problematic though. In fact, Aristotle in his Poetics stated that this literary device (deus ex machina) was not very eloquent. Resolution, he believed, should come from the play itself.