Hamlet's father comes to him in Act I as a ghost and tells him that King Claudius has murdered him. The ghost tells Hamlet to seek revenge for his murder. Hamlet is distraught by the death of his father and also by the marriage of his mother to her brother-in-law. All of the grief that he experiences leads Hamlet to contemplate suicide. We see his contemplation during his famous soliloquy, "to be, or not to be; that is the question:" (3.1.58). Hamlet is grief-stricken yet he is uncertain that if he were to end his life, things would be any better.
Hamlet is a Christian and to commit suicide would be against his religion. Hamlet seems to be concerned with what the nobler thing to do is, "whether tis nobler in the mind to suffer/ the slings and arrows of outrageous fortune,/ or to take arms against a sea of troubles,/ and, by opposing, end them" (3.1.59-62). If Hamlet committed suicide, it would not be a noble act and he would get no credit for revenging his father's death. Many people, other than a crazy man who was weak and could not endure the loss of his father, may not remember hamlet. If Hamlet were to die, by taking his own life, than he would "sleep" and by sleeping he figures he would put an end to "the heartache and the thousand natural shocks/ that flesh is heir to" (3.1.64-65). He would have no worries and no more heartache. The pain that he feels would be put to an end. This may be an easy way to end the pain but it is far from noble.
Hamlet is wisely contemplating his choices in life, he could end his life as well and be done, a very easy way out, but also this leaves the murderers and the oppressors free. Hamlet's father was murdered and yet Claudius, the accused, has apparently gotten away with