"To be or not to be" is the opening phrase of a soliloquy in the nunnery scene of William Shakespeare's play Hamlet, Act 3, Scene 1. In the speech, Hamlet contemplates death and suicide, weighing the pain and unfairness of life against the alternative, which might be worse . The soliloquy begins with the memorable line, “To be, or not to be, that is the question”.

I hope this helps. Let me know if you have any other questions.