After he sees the ghost and hears his revelations, Hamlet tells Horatio that he is going to pretend to be mad, but not to worry: it is all a ruse that will keep the other people in the court off kilter. However, there does seem to be one point in...
After he sees the ghost and hears his revelations, Hamlet tells Horatio that he is going to pretend to be mad, but not to worry: it is all a ruse that will keep the other people in the court off kilter. However, there does seem to be one point in the play where Hamlet has gotten so frenzied that he has possibly tipped into madness. This is when he confronts his mother in her bedchamber about Claudius.
In act 3, scene 4, Hamlet, who has just refrained from killing Claudius because he believes he is praying, talks to his mother about why she married Claudius. His language is quite harsh, and she fears he will kill her, so she cries out. Polonius, who is hiding behind the tapestry, moves, and Hamlet impulsively kills him, thinking he is Claudius.
In this scene, Hamlet cries out that he sees his father's ghost. However, unlike on the ramparts at the beginning of the play, when Horatio and the guards saw the ghost as well as Hamlet, his mother sees nothing. This suggests that at this moment Hamlet may be hallucinating. Some quotes for act 3, scene 4 that indicate madness are as follows. Hamlet sees the ghost (or so he thinks) and says aloud:
"Save me and hover o'er me with your wings,
You heavenly guards!—What would your gracious figure?"
"Alas, he’s mad!"
A little later, as Hamlet speaks to ghost, Gertrude tells him how mad he looks, with hair standing on end, speaking to nothing, and behaving excitedly:
"Alas, how is ’t with you,
That you do bend your eye on vacancy
And with th' incorporal air do hold discourse?
Forth at your eyes your spirits wildly peep,
And, as the sleeping soldiers in th' alarm,
Your bedded hair, like life in excrements,
Starts up and stands on end. O gentle son,
Upon the heat and flame of thy distemper
Sprinkle cool patience. Whereon do you look?"
She also says:
"This the very coinage of your brain."
By this she means he is hallucinating.
It is out of character for Hamlet to act with impulsive violence as he does when he stabs Polonius. It is also out of character for the ghost to show up inside the castle.