Hamlet uses his apparent insanity to prevent anyone from knowing he is suspicious about his father’s death.
Hamlet is crazy like a fox. When his father dies, he is devastated. It sinks him into a deep depression. His father visits him as a ghost, and tells him what really happened. ...
His father was murdered by Hamlet’s uncle, who used the death to marry Hamlet’s mother and become king. He implores Hamlet to avenge his death.
Prince Hamlet does not take the news well. It does not help that his father wants him to get revenge. Hamlet is not really a violent person. He is faced with indecision about how to proceed. He decides to fake crazy, taking advantage of his prior mental state to throw everyone off. It is not hard for people to believe that Hamlet is nuts, because he has never been the most stable person. He is angry at his mother for marrying Claudius.
Hamlet’s friends worry about him. Ophelia is horrified at how he acts toward her, peppering her with crude innuendo. It is not like him at all. He needs Ophelia for his crazy act. People assume that he is mad with love for her. Hamlet explains to Guildenstern that he is not really insane. He admits it is all an act to throw off Claudius and Gertrude.
You are welcome: but my
uncle-father and aunt-mother are deceived.
In what, my dear lord?
I am but mad north-north-west: when the wind issoutherly I know a hawk from a handsaw. (Act 2, Scene 2)
His antics get zanier and zanier. Hamlet kills Polonius and won’t tell anyone where the body is, pretending he is playing hide and seek with it. He also makes very inappropriate comments when pressed about where Ponlonius is.
Now, Hamlet, where's Polonius?
At supper! where?
Not where he eats, but where he is eaten: a certainconvocation of politic worms are e'en at him. (Act 4, Scene 3)
Anyone who observed this exchange would assume Hamlet was crazy. Who says things like that?! Hamlet is messing with Claudius though. He actually does feel bad about Polonius. It was an accident. He did not know that it was Polonius hiding. He desires to kill Claudius, and get revenge. He is not on a murderous rampage.
Between Ophelia and Polonius, no one has any trouble believing Hamlet is a few Fruit Loops short of a bowl. He is able to use this to devise a scheme for revenge. Unfortunately, it results in his death, and the deaths of Laertes and his mother as well as the king. Ophelia commits suicide.