And then it started like a guilty thing
Upon a fearful summons. (I.i.147–148)

When the Ghost disappears at the sound of a crowing rooster, Horatio uses this simile to compare the Ghost’s reaction to that of a guilty person who panics when caught in the act.

But look, the morn, in russet mantle clad,
Walks o'er the dew of yon high eastward hill. (I.i.165–166)

In this metaphor, Horatio compares the sunrise to a person in a reddish cloak approaching from a distant hilltop. 

Fie on ’t, ah fie! 'Tis an unweeded garden
That grows to seed. Things rank and gross in nature
Possess it merely. (I.ii.135–137)

In this metaphor, Hamlet compares the world to a garden in which weeds have taken over and begun to multiply.  

         Think yourself a baby
That you have ta'en these tenders for true pay,
Which are not sterling. (I.iii.105–107)

In this double metaphor, Polonius calls Ophelia a baby, suggesting that she is naïve for believing that Hamlet’s affections (“tenders”) for her are true when in fact they are like counterfeit silver coins.  

The serpent that did sting thy father’s life
Now wears his crown. (I.v.39-40)

In this metaphor, the Ghost of Hamlet’s father compares Claudius to a poisonous snake who bit him and then took over as king after his death.  

To be, or not to be? That is the question—
Whether ’tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them? (III.i.57–61)

In this mixed metaphor, Hamlet compares his misfortunes first to an attacker assailing him with “slings and arrows” and then to the sea, which threatens to overwhelm him with troubles. He ponders whether it is nobler to endure his troubles or arm himself and fight back. 

Be thou as chaste as ice, as pure as 
snow, thou shalt not escape calumny. (III.i.137–138)

Speaking to Ophelia, Hamlet uses a simile to compare chastity to ice and snow, suggesting that it is both pure and cold, or lacking in passion. 

It is as easy as lying. Govern these ventages 
with your fingers and thumb, give it breath with  
your mouth, and it will discourse most eloquent 
music. Look you, these are the stops. (III.ii.322–325)

In this simile, Hamlet sarcastically tells Rosencrantz and Guildenstern that playing a pipe is as easy as lying (which they have been doing to him). He means, ironically, that their lies sound as ridiculous as a person trying to play a musical instrument without knowing how.  

                        The cease of majesty
Dies not alone, but, like a gulf, doth draw
What’s near it with it. (III.iii.15–17)

Attempting to flatter Claudius, Rosencrantz uses this simile to compare a king to a vast body of water who, if he were to die, would drag many others along with him like a receding wave pulling bystanders out to sea. 

                                The other motive
Why to a public count I might not go,
Is the great love the general gender bear him,
Who, dipping all his faults in their affection,
Would, like the spring that turneth wood to stone,
Convert his gyves to graces . . . (4.7.16–21)

In this simile, Claudius compares the common people’s love for Hamlet to a magical spring that can transform wood into stone. Although guilty of killing Polonius, Hamlet’s shackles would likewise be transformed into “graces” in the eyes of the people if he were punished.