How does Hamlet's mental state change throughout Shakespeare's Hamlet?
I would argue that the first change we see in Hamlet's mental state occurs when Hamlet first sees the ghost (and the ghost leads him away from his friends) in Act I, scene 5. In this scene, his mental state changes rather quickly. Hamlet's dialogue (and his friends' responses to him) makes this clear. He addresses his friends with an odd response, "Hillo, ho, ho, boy! Come and come." The back-and-forth that follows between Hamlet, Horatio, and Marcellus suggests that Hamlet's mind is not "right" and that his friends are having difficulty following his line of logic. This dialogue makes it evident that Hamlet has become unsettled by his conversation with the ghost. After line 175, Hamlet tells his friends that he may "put an antic disposition on," suggesting that he initially PLANS to feign madness. It can be argued throughout the course of the play whether Hamlet is truly feigning (pretending) to be mad or whether he is truly mad. Perhaps he starts out intending to pretend but drives himself mad by the play's conclusion.
However, this is certainly not the only scene in which Hamlet's mental state undergoes a change. He is torn between action and inaction, doubt over whether he should kill Claudius or wait to see if he has a better opportunity.
Another favorite scene of mine in which Hamlet's mental state changes abrpubtly is his exchange with Ophelia in Act III, scene 1 (when she tries to return the gifts he has given her). Here, he seems to "lose it" again. He asks her if she is "honest" and "fair" -- seemingly because he is shocked that she would play with his emotions and follow the orders of her father when she had previously acted as though she loved him.
Throughout the play, Hamlet has doubts about who he can trust. He knows that he cannot trust Rosencrantz and Guildenstern, for example, because they did not honestly tell him that they had been sent for by Claudius and Gertrude.
Each time Hamlet is forced to come to terms with the fact that he has been betrayed, his state of mind seems to take a further step back.