When the queen acts as stubbornly as she does, and sees no wrong in the virtually adulterous acts which she has committed, it leads people to believe that this has led to Hamlet's "madness." But of course, this just pushes Hamlet's act a bit further - having people feel bad for him because he's insane.
Hamlet also demonstrates that he is not insane because he speaks civilly when he is alone or speaking to Horatio. He only returns speaking weirdly when feigning insanity. This change is most obvious in act 3, scene 2. Hamlet trusts Horatio, as demonstrated by his line, "Horatio, thou art e'en as just a man/As e'er my conversation cop'd withal." This close bond of friendship allows Hamlet to speak freely about his plans and his difficulties with Horatio. His eloquent verse which follows shows that he still retains his sanity. However, as soon as Claudius returns, Hamlet once again speaks in nonsense: "Excellent, i'faith, of the chameleon's dish. I eat the air, promise-crammed. You cannot feed capons so." This sharp return in response to the King's presence shows that Hamlet's insanity is simply a part of his plan to revenge his father. If Hamlet were truly going mad, his manner of speech would not change depending on the person to whom he was speaking. That he is able to speak as normally and civilly as any other character when he is talking to a trusted friend demonstrates that Hamlet is not actually insane, but putting "an antic disposition on" so that he may revenge his father's murder.
From the beginning of the play, Hamlet disliked his step-father and uncle, King Claudius, and didn't even try to hide it: "A little more than kin and less than kind," stated Hamlet mockingly. King Claudius knew that it was quite unruly for him to marry his brother's wife within months of his death. This immediately severed the relationship between Hamlet and the King. When Hamlet received a visit from the ghost of his father, he discovered that Claudius had killed his father in order to gain control of Denmark.