William Shakespeare's Famous Quote

"To be or not to be"

What does this quote mean?

In William Shakespeare's Hamlet, in the middle of the play,Claudius and Gertrude discuss Hamlet’s behavior with Rosencrantz and Guildenstern. Polonius hears Hamlet coming, and he and the king hide to spy on Ophelia and his conversation. Hamlet poses the problem of whether to commit suicide or not, "To be or not to be". This means to live or not to live. Life is bad but death might be worse.