One of the main themes explored in Oedipus Rex, simply put, is the age-old question of what controls human destiny, fate (the gods) or our own personal choices (free will).
In the play, the entire plot centers around a god-given prophesy (or spoken fate), that Oedipus would one day kill his father and marry his mother. His parents immediately attempt to protect their child from this fate and order his death. The baby is not killed, however, and grows up to fulfil the exact details of the prophesy.
As in most of Greek literature and the culture of ancient Greece, the roll of the gods here is as the higher power believed to be in control of human destiny. The ancient Greeks believed the gods controlled everything, from seasons and weather, to prosperity and poverty.
As you know from reading the play, the characters consistently appeal to Apollo for answers, then choose to act independently to change the outcome of what he decrees (fate versus free will). The characters understand that the famine in the land is due to something that has angered the gods, therefore they seek to discover the root of the problem, and eliminate it. Oedipus leads the charge. When he is named as the problem, however, he is arrogant and defiant. By ignoring Teiresias, he completely fulfils the destiny he was given as a baby, which is the same destiny his parents were also unable to protect him from.
Some argue that the gods were in control all along, because no matter what Oedipus or his parents tried to do, he still fulfilled his damning prophesy. Others argue that nothing would have happened at all if Oedipus' parents would not have originally tried to escape their son's fate, or if the shepherd would have fully carried out his orders, or if Oedipus had not grown up to become so arrogant and let his anger control his actions.
So, do we control our fate by the choices we make, or is there a higher power that is ultimately in control? The answer to this question remains ambiguous at the end of the play. One reason the play continues to be read and studied is because of this very theme. Even in today's religious beliefs, this question arises often, and continues to be debated. Humans still argue over the fate versus free will debate.