I can add a couple more examples. In Act 2, Hamlet's conversation with Rosencrantz and Guildenstern that begins with "What a piece of work is man," is an example of a speech that questions man's purpose in the world. In this speech Hamlet looks at the exquisitely formed human and questions the purpose of this "quintessence of dust."
In Act 4, Hamlet explores once more the purpose of human existence in his soliloquy beginning with "How all occasions do inform against me." Here he explores the purpose of action and how it justifies a man's life.
In Shakespeare's Hamlet, we find there are many quotations that reflect Hamlet's take on human existence: this is, after all, one of the major complexities of the play...Hamlet's ability to deal with the serious nature of life: his own, in connection with others.
Hamlet speaks of human existence in the "To be or not to be" speech.
To die—to sleep,
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to:...
(The entire section contains 3 answers and 850 words.)