At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
By "to be or not to be" Hamlet is actually considering suicide - to be (live) or not to be (die). Ultimately, he decides against suicide due to the fear of retribution in afterlife.
Not the answer you are looking for? Search for more explanations.
Hamlet is contemplating suicide, he is asking whether to exist or not.
Hamlet is also questionin human existence much as some of us do today. The Early modern period is characterised by this line of questioning, man's place in the uniiverse was being challenged by science, God came under fire, Descartes started this, William Shakespeare picked up a popular theme and hey presto :)
To BE or not to BE, famous Hamlet Soliquoy. Will he 'be' and keep things as they are or not to be fight against what he knows to be wrong. Go figure.