At the opening of Sophocles' Oedipus the King, we learn that Thebes is being ravaged by a terrible plague. Oedipus, the king of Thebes, has sent his brother-in-law, Creon, to Delphi to consult the Delphic oracle about a remedy for the plague. When Creon returns, he informs Oedipus that the plague will end once the Thebans drive out the killer of their previous king, Laius. That killer's continued presence in Thebes is the cause of the plague.
Oedipus, desiring to help his troubled town, calls in the prophet Teiresias in hopes that he will provide additional information about Laius' killer. Teiresias does not want to comment on the situation because he knows that Oedipus killed Laius. However, after an angry Oedipus mocks Teiresias' blindness and threatens him, Teiresias tells him that "the accursed polluter of this land is you" (line 421 in the Ian Johnston translation). Thus, Teiresias accuses Oedipus of killing Laius. When Oedipus claims that Teiresias is not speaking clearly, Teiresias plainly tells Oedipus that he is "the very man you’re looking for" (434 in Johnston). Teiresias also indicates to Oedipus that he is married to his own mother:
I say that with your dearest family,
unknown to you, you are living in disgrace.
(439-440 in Johnston)
As for why it takes Oedipus so long to recognize his guilt and to admit what he has done, this is partially a product of the playwright's desire to build suspense (after all, it wouldn't be much of a play if it ended after just 450 lines) and partially a product of human nature.
When people are accused of something, it seems like the most common impulse is to deny the accusation. Oedipus has been accused of some of the most horrific deeds imaginable to human beings: he has killed his father and married his mother. I find it difficult to believe that any person on our planet, if accused of such horrific deeds, would quickly and readily admit guilt. Surely, a person accused of such a deed would initially deny the accusation. Surely, a person accused of such a deed would want clear and undeniable proof of these actions.