This counselor is now most still, most secret, most grave, Who was in life a foolish prating knave.
Act 4 Scene 7
She fell in the weeping brook. Alas, then she is drowned.
After Hamlet learns of his father's death, his desire for revenge sets in and his personality completely shifts as a result. Hamlet goes mad, or at least pretends to be, and is at a constant internal battle with himself to finally kill his uncle.
After Polonius's death Hamlet becomes very rude and blunt with his dark humor. Most notably, he makes a morbid joke about how Polonius is at dinner being eaten by worms. Also, after this death Gertrude finally learns the truth about her first and second husbands and the false insanity of her son.
In this scene, Ophelia dies. When Hamlet find out about her death, he reveals that he genuinely loves Ophelia. Then, the other characters realize that Hamlet truly is sane. From this point forward, Hamlet becomes more carefree with his concerns on death (he nonchalantly participates in fencing and actually kills Claudius).