I believe Lord Hamlet, here, is contemplating the value of life and weighing its positives and negatives. To be; live, not to be; die. He processes the option of suicide, which is quite such an extreme option in his circumstances of turmoil. At this point in the play, Hamlet is emotionally spent and he seems a dagger to the heart may be the right answer. The status of this monologue correlates with the beginning of the play. Both start with an intriguing question. In the beginning, Banardo asks, Who's there? This question gives suspense and grabs the audience to wonder what's happening next.
He goes on to say, 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? [Scene 3.1, Line 58-61]
Interestingly enough, Hamlet still has a logical mindset about suicide. He talks about whether it is better to go through life and have bad fortune and try to form a smile during the hard times or don't tarry in life's conflict, when there's an easy way out; suicide. Unlike Hamlet, Greek mythology figure Ajax killed himself over the general consensus that he wasn't worthy enough to get prized amor against Odysseus. Ajax couldn't handle bad fortune against him and he decided to take the easy way out. But, Hamlet is thinking, Why suffer if we are born into bad luck, we can void this by death. Ironically, it seems that Hamlet hints toward Catholicism or Christianity. His belief in soul's returning as ghosts and murderers destined for Hell shows his insinuated religion. If he were to practice any type of Christianity, suicide is something out of his beliefs. Why would he think of such a catastrophic end.
Hamlet continues, To die, to sleep / – No more. [Scene 3.1, Line 60-61]
His thinks all death is is sleep – terminal sleep. It is interesting to see although his has a Christian-esk moral compass, Heaven or Hell does not seem to be his afterlife; dreaming does. It is as if Heaven or Hell does not play into his circumstances.
Hamlet then said,—and by a sleep to say we end / The heartache and the thousand natural shocks. [Scene 3.1, Line 62-63]
After he's proclaimed that dying is a state of limbo, he says limbo is a closure of the misfortune that happens in life. And, assuming that he vaguely practices Christian beliefs Heaven is not limbo. It does not exist. But, in a state of absence, it seems that that is Hamlet's way of release and he talks about it as if it may be chance at happiness.
After he said,That flesh is heir to – 'tis a consummation / Devoutly to be wished! [Scene 3.1, Line 64-65]
He talks about limbo as if that's where he ultimately wants to be – and soon. And, suicide would get him there on his own time. In lines 60-65, he elaborates on how living is basically worthless because of the bad things that happen. He thinks, instead of dealing with life, and it's trials and tribulation, he'd rather die.
Hamlet went on; To die, to sleep. / To sleep, perchance to dream. [Scene 3.1, Line 66]
He says that since dying is sleeping, one can also have dreams. It's as if this terminal sleep brings dreams that would become the dead person's new reality.
He then recoils his argument; ay, there's the rub, / For in that sleep of death what dreams may come / When we have shuffled off this mortal coil, / Must give us pause. [Scene 3.1, Line 66-69]
Even though death means sleep, and sleeping yields dreams, Hamlet said that there's always a catch, those dreams may not peachy or the ideal. There's no guarantee that dreams will be good and there's always the possibility of them being horrific. So, one needs to be conscience of that in the attempt of suicide, in Hamlet's terms.
The question; is suicide the answer? In this excerpt of Hamlet's monologue, and in this context, he talks about the possibility, the positive and the negatives in his mind. Based on one's interruption, it's up to the reader or audience to decide, but as the monologue progresses, Hamlet contradicts himself.