In Sophocles' Oedipus Rex, Plato's Apology, and William Shakespeare's Hamlet the protagonists are all portrayed as searching for some form of truth. As you work on writing a critical comparison, you should address the motives behind their search and the types of truths they are searching for.
Socrates, in Plato's Apology, states that his motive for beginning his quest for truth and wisdom started with a response by the Delphic oracle to a question from Chaerephon:
Chaerephon, ... went to Delphi and boldly asked the oracle to tell him ... whether anyone was wiser than [Socrates], and the Pythian prophetess answered, that there was no man wiser.
He sees his search for wisdom, and questioning of people reputed to be wise, as a divinely mandated quest. Unlike the Hamlet and Oedipus, he is not searching for some individual piece of information, but for some sort of absolute truth or wisdom, knowledge of the absolute good itself rather than specific instances of goodness.
In the cases of Oedipus and Hamlet, the search for truth is more limited, their objects being to answer specific questions about the identity of murderers. While all three characters, Socrates, Oedipus, and Hamlet, seek truth by asking people questions, in the case of Hamlet and Oedipus the questions cease when answers are found, but in the case of Socrates, the search for wisdom by questioning is itself a goal.
A final and interesting area for comparison is the role of the supernatural or divine in all three works. Socrates' search is prompted by an oracle and his behavior guided by a daimonion (divine sign). Hamlet is prompted to act by his father's ghost and Oedipus consults the prophet Tireisias.