What is the meaning or purpose behind the "to be or not to be" soliloquie by Hamlet?
In this famous speech/soliloquy, Hamlet weighs the pros and cons of living versus the pros and cons of dying (implying a consideration of suicide). Hamlet wonders whether it is worth living with all of his grief and disappointments. He then considers death as an alternative but is uncertain because he is uncertain about what death and/or the afterlife might bring:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take up arms against a sea of troubles,
And, by opposing, end them. To die, to sleep-
No more, and by a sleep to say we end
The heartache and the thousand natural shocks
That flesh is heir to- 'tis a consummation
Devoutly to be wished. To die, to sleep.
To sleep, perchance to dream. Ay, there's the rub,
For in that sleep of death what dreams may come
Hamlet wonders if the noble thing to do is to "take up arms" and face his problems (his father's murder, his revenge, his angst with his mother, etc.) or to choose death. This philosophizing and rationalizing is part of Hamlet's way of dealing with trouble. He thinks, even over-thinks, everything; this is one of the main reasons for his delay, why he continually puts off killing Claudius. Hamlet tries to consider the pros and cons of every detail. Hamlet considers death ("not to be") but he supposes it may be worse than the troubles he is facing in his life. "But that dread of something after death, / The undiscovered country from whose bourn / No traveller returns, puzzles the will, / And makes us rather bear those ills we have" (III.i.80-83). Here Hamlet considers that the uncertainty and fear of what might lie beyond death is too uncertain. This is why, he reasons, that death makes us choose to live and face our problems: "makes us rather bear those ills we have."