Hamlet pretends to be mad throughout the play in order to manipulate other characters, namely Claudius. In Act 3, Scene 4, Hamlet kills Polonius and then talks to his dead father's ghost. Gertrude sees this and declares he is mad. In Act 4, Scene 1, Gertrude tells Claudius that Hamlet killed Polonius. It is debatable whether or not she truly thinks Hamlet is mad, but she does tell Claudius that Hamlet's madness made him commit the crime. This is an attempt to somehow justify Hamlet's actions, his madness being an affect of grieving for his father.
To draw apart the body he hath killed,
O'er whom-his very madness, like some ore
Among a mineral of metals base,
Shows itself pure-a weeps for what is done. (IV.i.23-26)
She claims he is mad but also "weeps" for what he's done. Gertrude tries to create the illusion that Hamlet feels remorse for the murder. His madness is appearance as is this alleged remorse; he really is unaffected by Polonius' death. Also, Claudius sends Hamlet to England, telling Gertrude this is for his protection. However, Claudius does this to plan the murder of Hamlet. There is a lot of playing with appearance versus reality simply because of all the lying. But overall in Hamlet, the major instance of appearance versus reality is Hamlet's feigned madness.