Act 4, Scene 4, Lines 33-65
It is important to be aware of the context of this famous soliloquy. Hamlet, on his way away from Elsinore and towards England, having killed Polonius, meets an army going to fight a battle in Poland. He sees that the willingness of the soldiers to sacrifice their lives for a small piece of foreign land is in direct contrast to his own reluctance to revenge his father. The example of the soldiers is therefore a rebuke to his own inaction. Looking at them, he is aware of his "dull revenge," and how it shows him, who has such cause to pursue revenge, in a bad light. Note the following quote:
How stand I then,That have a father killed, a mother stained,Excitements of my reason and my blood,And let all sleep—while, to my shame, I seeThe imminent death of twenty thousand men,That for a fantasy and trick of fameGo to their graves like beds, fight for a plotWhereon the numbers cannot try the cause,Which is not tomb enough and continentTo hide the slain?