How does Sophocles use foreshadowing to hint at Oedipus's downfall in Oedipus Rex?
The question of foreshadowing in any Greek tragedy strikes me as a little bit difficult to deal with because almost all of the audience would have known the basic plot of the story before the play even began. Still, Sophocles leaves no doubt in his play that Oedipus is going to fall and fall hard.
For example, in the play's prologue, the Priest urges Oedipus to take action regarding the plague unless he wants to be king "in a desert" (Ian Johnston translation). I find in this statement some irony because by the end of the play Oedipus will no longer be king of Thebes and he will have to wander as an exile far from the society of his fellow human beings.
Later, after learning from Creon that they must expel Laius' killer from Thebes, Oedipus again ironically foreshadows his own demise as he urges his fellow citizens, "Ban him from your homes."
Likewise, in the same speech, Oedipus ironically foreshadows what befalls him at the end of the play when he unwittingly calls down upon himself the same curses that he invoked upon Laius' killers. Oedipus says that even if the killer turned out to be an "honoured guest" in his own home, he prays that he himself "suffer all those things I’ve just called down upon the killers."
So, from the beginning of the play, Sophocles leaves his audience numerous indications that things will turn out badly for Oedipus.