One of the primary questions in Hamlet, by William Shakespeare, is whether or not Hamlet, is mad or "mad in craft." While he makes several comments about his feigned madness to others, Hamlet only reveals his true thoughts in his soliloquies.
His first soliloquy occurs during Hamlet's first scene on stage (Act I, scene ii). After we learn that Hamlet is mourning too dramatically to suit the taste of his mother and new stepfather-uncle, Hamlet speaks his first soliloquy; the first thing he says is that he wishes he could die.
This could cause us to wonder about Hamlet's sanity--IF he does not express his perfect understanding that God does not sanction suicide and his explanation of why his father's death and mother's remarriage has impacted him so dramatically. Gertrude did not even wait a month after King Hamlet's death before marrying her husband's brother, a man whom Hamlet considers to be inferior to his father in every way.
A little month, or ere those shoes were old
With which she follow'd my poor father's body,
Like Niobe, all tears:--why she, even she--
O, God! a beast, that wants discourse of reason,
Would have mourn'd longer--married with my uncle,
My father's brother, but no more like my father
Than I to Hercules: within a month:
In this soliloquy, Hamlet is rational enough to know the consequences of suicide, and his reaction to recent events in his life are significant enough to warrant excessive mourning.
Hamlet's next soliloquy occurs at the end of Act III, after he meets with the players, and one of them delivers a moving speech about a fictional character. When he is alone, Hamlet scolds himself for having much more cause to be passionate than this actor, yet he has failed to act.
Hamlet calls himself every kind of a scoundrel in this soliloquy, and it all seems justified, given the promise he made his father's ghost and his own resolve to avenge King Hamlet's murder.
A dull and muddy-mettled rascal, peak,
Like John-a-dreams, unpregnant of my cause,
And can say nothing; no, not for a king,
Upon whose property and most dear life
A damn'd defeat was made. Am I a coward?
After his self-scolding, Hamlet makes a plan. He has heard that guilty people will sometimes, if they see their deeds reenacted on a stage, confess to their crimes. Perhaps Hamlet is sane here, because he does not want to kill an innocent person (and so far the only one who called Claudius a murderer is a ghost). Perhaps he is beginning to lose perspective on his ability to do what he promised and is now grasping at straws to find a way to justify killing--or not killing--Claudius. In either case, Hamlet seems more rational than mad.
In the very next scene (Act IV, scene i), Hamlet delivers his famous line: "To be, or not to be: that is the question." Again he considers committing suicide but decides against it because no one knows what happens after death. He claims he would rather die than bear his burdens until he thinks about "death / The undiscover'd country from whose bourn / No traveller returns."
This soliloquy is interrupted by Ophelia's arrival, but his last words are another explanation (excuse) for his failure to act. While he seems melancholy and discouraged here, he still reasons and therefore still seems sane.