Hamlet is a depressed young man. His father died and by the action and words of the play, Hamlet and his father had a close, loving relationship. Then, when Hamlet gets home from college in Wittenberg, finds out that not only has his mother remarried so quickly after his father's death, but she has married her deceased husband's brother. Since, in the eyes of people of the time, when a woman married a man, she became part of his family making his brothers her brothers, Gertrude was being incestuous marrying her husband's brother. On top of these woes, Hamlet's father's ghost has told him that his new step-father, his own uncle, has killed his father and now the ghost wants Hamlet to get revenge by killing Claudius. Hamlet is a deeply contemplative man and he broods in his contemplations, so all this adds up to a depressed individual. In his Act 3, sc. 1 "To be, or not to be..." soliloquy, Hamlet is thinking about suicide. His religion forbids it as a mortal sin, so that gives him pause. Also, he goes on to say, that the fear of what happens to a spirit after death - that place where no one comes back from - makes people afraid to kill themselves, himself included. He also asks whether living isn't actually harder than death. In living, one has to continue to put up with life's problems, but in death, perhaps one avoids all problems. The speech asks more questions than it does anything else. The purpose, then, of the speech is to let the audience know what Hamlet is thinking about and what his current mindset is. This speech lets us know that Hamlet is a deep thinker, that he is depressed, and that he wishes he could end his life and avoid his problems, but he won't do that.