Certainly, we get a glimpse of Hamlet’s poor mental health in this scene, as he enters debating whether or not he ought to take his own life. He seems to wish for the peace and and end to his problems, but he worries about “what dreams may come” in death: in other words, he fears that the afterlife which follows life could be worse (3.1.74).
When Ophelia addresses him, he calls her “fair” and responds politely to her, but his politeness quickly turns to rancor when she returns to him several letters and gifts he has given to her. He says, “I did love you once,” and then, in the next breath, “I loved you not” (3.1.125, 129). He tells her to go to a nunnery, also an Elizabethan euphemism for a brothel, and his words are so ambiguous that it seems unclear as to which place he would have her go.
Ophelia clearly feels that Hamlet’s words make his madness evident, as she cries out, “O, help him, you sweet heavens!” and the like (3.1.145). She wishes that the powers of heaven would “restore him” (3.1.153). After he leaves the scene, she declares, “O, what a noble mind is here o’erthrown!” (3.1.163). Ophelia, who seems to know Hamlet fairly well, clearly believes that he has become mad, that he is no longer in full possession of his mental faculties. Polonius and the king, who have been watching from a hiding spot, agree that Hamlet has lost his mind. The king suggests that they continue to watch Hamlet closely, due to his apparent madness.