What does Sophocles intend to prove and illustrate in Oedipus Rex?
We can argue that the central theme of this play is man's ignorance and his subordinate relationship to the gods. The story of the play clearly illustrates the folly of man's attempts to overcome the will of the gods.
The idea is articulated directly in the dialogue as well, as we see here in these lines from Jocasta:
Why should a person fear when the ways of fortune
are supreme, when there is no clear foresight? (1005)
It’s best to live at random, however one can.
The tragedy of Oedipus' fate is that he is born into a situation that dooms him (via prophecy) to live out a nightmare. He is destined to marry his mother and to kill his father. Given this proclamation at birth, Oedipus sets out to avoid his fate. This is a noble and honorable endeavor. Accepting the kind of fate prophesied for him would be unthinkable.
Oedipus is, however, powerless against the will of the gods. Man cannot choose his own fate. Man is not in control. This is a primary message of the text.
...the oracle remains true, and Oedipus is helpless in the face of its powerful prophecy.
Importantly, Oedipus fails to escape his fate due to human ignorance. Hubris (pride beyond justification) is one of Oedipus' weaknesses. We can see that his efforts to escape fate constitute a false pride (along with his personality traits, his will to power, etc.) and, because he is not omniscient, he cannot know how to avoid his fate. He does not know who his real father is. He does not know who his real mother is.
Without a greater degree of knowledge, Oedipus has no chance to escape his fate. His ignorance is too great. Yet, this ignorance is symbolic of the human condition. Again, it is no fault of his own if Oedipus is not omniscient. Mankind is limited, as Jocasta says, and cannot know "the ways of fortune".