What a piece of work is a man
The phrase "What a piece of work is a man!" comes from Shakespeare's Hamlet, Prince of Denmark, Act II, Scene 2, and is often used in reference to the whole speech containing the line.
The speech
The monologue, spoken in the play by Prince Hamlet to Rosencrantz and Guildenstern, follows in its entirety. Rather than appearing in blank verse, the typical mode of composition of Shakespeare's plays, the speech appears in straight prose:
Meaning
SparkNotes explains that Hamlet is saying while humans appear to think and act "noble" they are really essentially "dust". Hamlet is expressing his melancholy to his old friends over the difference between how men aspire to how they act, which is a great divide that depresses him.
Differences between texts
The speech was fully omitted from Nicholas Ling's 1603 First Quarto, which reads simply:
This version has been argued to have been a bad quarto, a tourbook copy, or an initial draft. By the 1604 Second Quarto, the speech is essentially present but punctuated differently: