Why does Hamlet delay? Why does he eventually act?
These questions have been debated for centuries. They are called "The Hamlet Problem." I think the best answer was given by Samuel Taylor Coleridge, who said Hamlet procrastinates because he thinks too much. When he acts on impulse, he can act very courageously. A good example is the way he is the first to board the pirate ship which kidnaps him. When Hamlet finally kills Claudius, it is impulsively, in the heat of emotion. He doesn't have time to think about it. He holds the poisoned foil right in his hand.
When Hamlet is on his way to England, he discovers his escorts Rosencrantz and Guildenstern are carrying a letter asking the English king to have him executed immediately upon arrival. Hamlet forges a substitute letter in which he has Claudius asking the English king to execute Rosencrantz and Guildenstern. This is before Hamlet is kidnapped by the pirates and then ransomed in Denmark by Horatio. At that point, Hamlet knows his life is in extreme danger because Claudius will soon receive word from England that Rosencrantz and Guildenstern have been beheaded. Claudius will know Hamlet forged a new letter and will certainly have Hamlet executed as a punishment and for the king's own self-protection. The following dialogue shows this.
It must be shortly known to him from England
What is the issue of the business there.
It will be short. The interim is mine.
Hamlet knows he must kill Claudius without further deliberation or Claudius will have him killed. He does not know Claudius has already made plans to have him killed in the forthcoming fencing match with Laertes.
Hamlet had other reasons for his previous delays. One was that he sincerely believed the ghost he met in Act I, Scenes 4 and 5 might be a devil instead of his father. In Act II, Scene 2 he says to himself:
The spirit that I have seen
May be a devil; and the devil hath power
T' assume a pleasing shape; yea, and perhaps
Out of my weakness and my melancholy,
As he is very potent with such spirits,
Abuses me to damn me. I'll have grounds
More relative than this. The play's the thing
Wherein I'll catch the conscience of the King.
Hamlet had to stage the play-within-a-play to prove to himself that Claudius was actually guilty, as the ghost had told him. After that, he felt free to act against the king, but he was forestalled by being sent to England as an ambassador.
One other reason Hamlet might have been slow in carrying out his obligation to kill Claudius is that Hamlet is aware he is supposed to inherit the throne when his uncle dies. All he has to do is wait. If he kills Claudius, it might be impossible for Hamlet to inherit the throne, especially if everyone believes he is mad. They would think Hamlet was motivated purely by ambition and would not believe Claudius murdered Hamlet's father in order to usurp the throne and marry King Hamlet's wife Gertrude. As a result, Hamlet is torn between acting and waiting for the crown to drop into his lap.
Hamlet has many human qualities that Shakespeare uses to such marvelous effect. It is why so many people can identify with him. It is what makes him so timeless. The reason Hamlet delays in the play is because delay, procrastination, "thinking too much" however one may characterize it, it is a particularly human quality. The ability to reason contrasted with bestial oblivion is a dichotomy that Shakespeare peppers throughout the play. So is thinking too much a problem? or is it a blessing? Shakespeare doesn't really provide the answers but he does pose the question.
But, look further. If delay is a human condition does it appear in other characters? Oddly, it does. One of the most obvious is Pyrrhus when he is about to kill Priam. He stops himself for however briefly it takes the First Player to ponder the weather of all things. Brilliant writing. Claudius delays sending Hamlet to England. Laertes delays in killing Claudius and then Hamlet. Notice that Laertes postured that he would cut Hamlet's throat in the churchyard and yet he got his fingers on Hamlet's throat in the graveyard and did... nothing! But, Laertes had reasons, I hear someone say. Of course! There are always reasons. My favorite delay is in the Murder of Gonzago. See where Hamlet announces the entrance of Lucianus, nephew to the king. Then Hamlet engages in petty banter with Ophelia leaving Lucianus to wait and make faces of evil intent until he can regain the stage from Hamlet's rantings. But, Hamlet draws attention to Lucianus' delay in poisoning the Player King as if it wasn't Hamlet's fault but Lucianus' fault. "Begin Murderer" Hamlet yells. "Pox, Leave thy damnable faces and begin." Then to cover his outburst Hamlet quickly narrates, "Come, the croaking raven doth below for revenge." Only then can Lucianus reclaim the stage and his murderous intentions.
Again, brilliant writing. But, the real subtlety is how well Shakespeare delays Hamlet's ultimate revenge on Claudius. In Romeo and Juliet the Prologue tells us the star crossed lovers are "now the two hours' traffic of our stage." Polonius in an off the cuff remark in act 2 scene 2 tells us that Hamlet, "he walks four hours together here in the lobby." Indeed when produced in its entirety, the play takes 4 hours. Shakespeare then is the real reason Hamlet delays?