I don't think Hamlet went crazy I think Hamlet was crazy from the start but there was somethings that pushed Hamlets crazy out near the end of the play. How he changed during the play is he could not kill people or get his revenge until he met up with Fortinbras, when his dad died Hamlet wanted to get revenge but he was to much of a kid to go kill him so he wrote a play to try to frame the new king of killing his dad.
I think the theme of the play is revenge because Hamlet try's to get revenge through the hole play, Fortinbras is going to Poland to get revenge, Laertes try's to get revenge on the king when he gets back and then on Hamlet too, the ghost tells Hamlet to get revenge for his death.
Hamlet: "here, thou incestuous, (murd'rous,) damned Dane, Drink off the potion. Is (thy union,) here?" (act 5 sc. 2 pg. 281) he says that to the king right before he makes him drink the poison .