One of the primary themes in Hamlet, by William Shakespeare, concerns Hamlet's inaction after his avowal that he will put every other thought aside and earnestly seek revenge for his father's murder. He does enact some kind of a plan in which he puts on an "antic disposition" and it works; others in the castle have noticed his odd behavior; however, none of it seems to be moving him any closer to his goal.
Earlier in Act III, Hamlet finally has the confirmation he thinks he needs when he sees Claudius react at the play, and he has never been readier to avenge his father's murder. Unfortunately, Hamlet is thwarted again because, though he does find Claudius alone, Claudius is praying and Hamlet does not want Claudius to die with a pure heart (something Claudius did not allow King Hamlet to do). Instead Hamlet vows to kill Claudius
When he is drunk asleep, or in his rage,
Or in the incestuous pleasure of his bed;
At gaming, swearing, or about some act
That has no relish of salvation in't;
Then trip him, that his heels may kick at heaven,
And that his soul may be as damn'd and black
As hell, whereto it goes.
In the the next scene, Hamlet is scolding his mother when he hears someone hiding behind a wall tapestry and assumes it is Claudius. Eavesdropping is not a particularly heinous offense, but Hamlet has waited long enough and he finally acts.
Hamlet is sorry he killed Polonius, but he had done what he could to warn Polonius (short of actually telling Polonius he intended to kill Claudius) and the "old man" did not heed the warning.
This act of accidental murder says several things about Hamlet's character. First, he is willing to act. Second, he is a serious-minded man who is unwilling to kill even a murderer until he is certain that Claudius is guilty. Third, he is a loyal son who is trying to obey his father's last request of him. Finally, he is not afraid to kill Claudius in front of a witness--even his own mother, Claudius's wife.
Whatever comes before, Hamlet is not weak or cowardly in this scene. He is willing to act now that he is thoroughly convinced that Claudius is guilty, and this attempt at revenge starts a chain of events which eventually allows Hamlet to fulfill his father's request.
The killing of Polonius is the plot device that drives the second half of the play and moves Laertes into the category of avenger. This is what brings the two together for their final battle. The closet scene certainly doesn't display toughness or virility. It shows mindless action guided by emotion. Of course it's not Claudius behind the arras. Hamlet just left Claudius. If he was thinking at all he would have realized that. But that is the point Shakespeare makes about revenge. It is a hot blooded act. It is not one based in reason and for that avengers suffer harshly.
That Hamlet can act bravely and decisively is shown in the incident with the pirate ship. His heartlessness with regard to Polonius is compounded twice over by his treatment of Rosencrantz and Guildenstern when he sends them to their deaths. He admits they are not near his conscience. But morally is Hamlet's conduct any different than Prince Fortinbras, who sends 20,000 men to their graves for an eggshell? As Claudius's soldiers Polonius, Rosencrantz and Guildenstern pay for their ambition with their lives.