Imagery, the representation through language of sense experience, is elaborately employed in Hamlet as a means of conveying underlying meaning in a concrete way while also evoking emotion.
"Something is rotten in the state of Denmark," Marcellus declares in Act I, Scene 4. Indeed, the most prevailing images in Shakespeare's Hamlet are olfactory. Marcellus's use of the phrase "state of Denmark" indicates that corruption exists in the entire hierarchy of the country, a theme of the play. Cleary, the graveyard scene of Act V represents this spiritual rotting as images of decay are suggested in Hamlet's conversation with clown as he asks him how long a man can lie in the ground before he begins to rot and the clown replies,
I' faith, if he be not rotten before he die—as we
have many pocky corses nowadays that will scarce hold the
laying in—he will last you some eight year or nine year. A
tanner will last you nine year. (5.1.158-162)
Even Claudius himself speaks of state of things as "rank" and "smell[ing] to heaven." Indeed, the general sense of inward and unseen corruption, of the man helplessly succumbing to a deadly and `foul disease' [IV.1.21], which feeds `even on the pith of life' is very prevalent throughout the play as it underscores theme.
Even Hamlet's olfactory sense is reserved for evil scents which evoke in him an intense repulsion as he reacts to the repugnance of badly prepared food. This repulsion for smells is translated into his revulsion of Polonius in Act II, for instance, as he calls the courtier a "fishmonger," alluding also to maggots in a dead dog.
Accompanying the olfactory imagery, there is also the visual imagery of weeds that suggests this spiritual decay and evil in court of Denmark. For instance, Hamlet speaks of the world as an "unweeded garden" and asks his mother to not
spread the compost of the weeds
To make them ranker (3.4.152-153)
Further, there are images of sickness and death that appear throughout, images that are greater than in any other play of Shakespeare's. This symbolic image of disease calls for a cleansing, and Hamlet eventually becomes convinced that he must kill Claudius, "this foul body of the infected world," the main cancer in Danish society.
Certainly, olfactory, gustatory, and visual imagery are especially effective in representing the corruption in the court of Denmark, a corruption that sickens Hamlet and disables him temporarily until he realizes that he must truly rid Demark of its disease.