Was Hamlet actually going mad in the play? Or was it just an act?
Centuries of critical ink has been spilled trying to answer this question: Is Hamlet mad? Is he a sane man feigning madness? Or a lunatic who does a really good impression of a man with all his marbles?
He claims to be putting an "antic disposition" on, claims to be not truly mad but "mad in craft", and some think that settles the question: Hamlet's putting on an act.
That answer doesn't satisfy everyone though: isn't it common for people in the grip of madness to believe, and in fact swear to everyone around them, that they are actually not crazy? Might Hamlet's insistence on his own sanity in fact be proof that he is actually mad? After all, mad people don't realize their own madness - that's part of what makes them mad.
So which is it?
The answer is both frustrating and exciting: we simply don't know. Shakespeare leaves the question of what, exactly, Hamlet's mental state is unanswered. There is evidence in the text that he is sane. There is evidence that he is anything but. The play will not give you a satisfactory answer.
The only place where this question gets an answer is in the theater, when you see the play performed. Actors and directors have to make decisions about Hamlet's behavior, and need to act on certain possibilities in the text and therefore exclude others. Some Hamlets are calculating, throwing everyone off by pretending to be crazy while he plots revenge. Others are crazed, unstable, and dangerous. Both are possible, but the question remains unsettled until a performance makes clear choices. That choice only settles it for that performance though - if you go see "Hamlet" in a different production with different actors, they may reach completely different conclusions...
Determining whether or not Hamlet was actually "mad" has been a favorite topic of Shakespeare scholars for decades. It seems to have been left open for interpretation entirely. Generally, there are two schools of thought on the topic: A) That Hamlet is MAD, and B) That Hamlet is not mad, but in his crafty way has developed a disguise of 'madness' in order to facilitate his revenge plot against Claudius. The second lends itself to a far more interesting and nuanced interpretation, and seems to be supported by Hamlet's own words.
It is the character Polonius who first accuses Hamlet of madness, when he goes to talk to Gertrude about her son. This is in Act 2, scene 2:
I will be brief. Your noble son is mad.
Mad call I it; for, to define true madness,
What is't but to be nothing else but mad?
His words, however, must be taken with a grain of salt, as he is only trying to look out for the best interests of his daughter Ophelia. In an aside, later in the scene, however, even he concedes to the audience that there is "method" to Hamlet's madness--suggesting that it is more planned than the Prince wants to let on. Then, in act 3 scene 1, Hamlet's friend Guildenstern makes a similar remark when he describes Hamlet's madness as "crafty".
Hamlet's uncle Claudius doesn't even really believe in the truth of Hamlets "madness":
Love? his affections do not that way tend;
Nor what he spake, though it lack'd form a little,
Was not like madness. There's something in his soul
O'er which his melancholy sits on brood;
And I do doubt the hatch and the disclose
Will be some danger... (III, I)
But the words which should best be believed are likely Hamlet's own, in a conversation with Gertrude:
My pulse as yours doth temperately keep time
And makes as healthful music. It is not madness
That I have utt'red. Bring me to the test,
And I the matter will reword; which madness
Would gambol from.
Make you to ravel all this matter out,
That I essentially am not in madness,
But mad in craft. (III, IV)
It seems clear then from this that Hamlet is not really "MAD", but just pretending in order to successfully carry out his plans.
Hamlet admits that he's putting on "an antic disposition"--that is, a show of being mad. However, critics have argued (almost since the play was first performed) about whether he is also actually losing his wits, possibly without realizing it, as a result of his lingering depression after his father's death. Some have even pointed to the ghost as the figment of a deteriorating mind.
From a textual point of view, the question boils down to whom you think Hamlet trusts. When Hamlet pretends to think that Polonius is a fishmonger, he obviously knows that Polonius is reporting back to Claudius. But when he yells at Ophelia to "get thee to a nunnery," does he realize he's being watched? His first conversation with Rosencrantz and Guildenstern turns strange fast; did he realize immediately that they had been "sent for," or did that come later? It's impossible to be sure, and different actors play those scenes very differently.
It's also interesting to consider a common proverb from Shakespeare's time: "Ambition is a great man's madness." Hamlet is trying to usurp the throne of Denmark, rising above his place in the natural order of the world. (Claudius is not a usurper, by the way--he was duly elected, making him "just" a fratricide).
So was Hamlet mad? I like to think he was. Even in Shakespeare's day, people knew that grief can have serious lasting effects, and Shakespeare was as well-informed about psychology as anyone at the time (his son-in-law, a doctor, specialized in it). But you're welcome to your own opinion.
Critics have long debated whether Hamlet is actually mad or is using his madness to confuse Claudius and Gertrude and figure out if they killed his father. One interpretation is that Hamlet's madness is a natural reaction to his uncle's murder of his father and his mother's conspiracy in the act. He tells his mother early in the play that he is angry that she has married Claudius only a month after his father's death. He says, "Frailty, thy name is woman!— A little month, or ere those shoes were old/With which she followed my poor father’s body." (Act I. scene ii.146-148). In a climate of fear and mistrust, Hamlet is justifiably driven insane.
Others have argued that Hamlet's madness is a ruse he uses to outwit Claudius and Gertrude to put on a play that will reveal whether Claudius is guilty of killing his father. For example, Hamlet says, "As I perchance hereafter shall think meet/ To put an antic disposition on" (Act I. scene V. 172-3). In other words, he finds it convenient to be antic, or mad, to outsmart the evil forces against him. Both points of view--that Hamlet is really mad or that he is using madness as a trick--have ample support in the play.
Madness in Shakespeare's time was not well understood. In his plays there was often an association between unnatural human acts and unnatural phenomenon. Seen particularly in Macbeth, with the wild and unnatural weather, and other omens, paralleling the breakdown in the social order.
In Hamlet the unnatural act of the king's murder, and the circumstances of the murder, upset the natural environment. There was something rotten in the state of Denmark. Hamlet's madness reflected that unnatural state. But was it an act? Probably so. A fool or jester can get away with what a sane person cannot. As Hamlet tells the Queen, "I essentially am not in madness, But mad in craft" (Act III. scene iv. 187-8.). It was an act, to allow him to put on his own act (the play within the play).