Both "Mad World" and Hamlet's first soliloquy are alike thematically in depicting an ordinary world that seems to have gone crazy. As he expresses in his soliloquy, Hamlet has come home to the royal court in Denmark to find his familiar world upended: his father is dead, his uncle is king, and his mother has married his uncle with what Hamlet calls "most wicked speed," making his head spin. As a result of all this, Hamlet has suicidal ideation--he dreams of being dead, wishing his body could "melt, / Thaw, and resolve itself into a dew!" He wishes God had not forbidden "self slaughter."
The narrator of "Mad World," as the title indicates, also feels his world has gone awry, with everything feeling sad and wrong. He sees people as "Going nowhere, going nowhere," and running in circles. Everything seems "worn out" and "mad." Like Hamlet, this speaker also wishes to "drown my sorrow," and seems to dream of suicide in the lines "No tomorrow, no tomorrow." However, while we know why Hamlet is upset, the reasons for this person's upset are never stated, leaving the listener to try to imagine the story.
Stylistically, both pieces use repetition for emphasis. Hamlet says "O God! O God!" early in his soliloquy and then repeats the words later to express his anguish. "Mad World's" speaker uses repetition as well, such as in "No expression, no expression," "very, very," and "mad world, mad world."
Both pieces also use imagery, which is description using the five senses of sight, sound, touch, taste, and smell. Hamlet compares his world to "an unweeded garden, / That grows to seed," something we can visualize. "Mad World" also uses visual imagery, such as in "worn out faces" and "tears ... filling up their glasses." However, Shakespeare's imagery is much richer, denser, and more allusive than that in "Mad World."