In William Shakespeare’s tragedy Hamlet, the title character is true himself in a number of different ways. Thus, he refuses to countenance any disrespect to his dead father, even or especially when such disrespect seems to come from his uncle, the new king, or from his mother, the queen who is also his father’s widow. It would have been politically convenient and advantageous for Hamlet to adapt himself to the new regime, but he refuses to do so. This is one way in which he remains true to himself throughout the play.
However, a more specific example of Hamlet’s integrity involves his refusal to act hastily in avenging his father after he has begun to suspect that his father was murdered. Instead of taking the claims of the ghost entirely at face value and killing Claudius at once, Hamlet famously delays pursuing vengeance. He does so partly because he wants to make absolutely sure that Claudius is indeed guilty of murdering Hamlet’s father. Rather than kill Claudius at once, Hamlet instead remains true to himself (and tries to remain true to the truth) by seeking incontrovertible evidence that Claudius is in fact a murderer. Thus, at one point Hamlet concocts a plan by which he hopes to prove Claudius’s guilt:
Hum, I have heard
That guilty creatures, sitting at a play,
Have by the very cunning of the scene
Been struck so to the soul that presently
They have proclaim'd their malefactions;
For murther, though it have no tongue, will speak
With most miraculous organ. I'll have these Players
Play something like the murther of my father
Before mine uncle. I'll observe his looks;
I'll tent him to the quick. If he but blench,
I know my course. The spirit that I have seen
May be a devil; and the devil hath power
T' assume a pleasing shape; yea, and perhaps
Out of my weakness and my melancholy,
As he is very potent with such spirits,
Abuses me to damn me. I'll have grounds
More relative than this. The play's the thing
Wherein I'll catch the conscience of the King.
Hamlet, in other words, tries to remain true to the ideal of reason, even though he is pretending to be mad. Rather than acting as a truly crazy person might or behaving like someone overcome with uncontrollable passion, he instead tries to remain true to the assumption that humans are reasonable creatures, made in God’s image, who should use their reason when trying to distinguish truth from falsehood. Hamlet, in other words, remains true to his commitment to genuine truth.