Hamlet's dilemma is to avenge his father's murder without sinking to the act of murder himself. He wants to fight injustice without becoming unjust. Thoreau, in his essay Civil Disobedience, discusses a very similar dilemma. He asks whether or not one can battle the injustice of large institutions without resorting to injustice and violence oneself. Hamlet can't find a way out of this dilemma and instead meanders in a maze of torment, self-doubt, and self-destruction. Thoreau avoided Hamlet's misery and proposed civil disobedience instead.
What if Hamlet had tried to oppose and depose Claudius using civil disobedience? It's pure speculation, of course, but do you think Hamlet's situation is so hopeless as he himself seems to believe? What might have happened if we built a time machine and sent irascible, ornery Thoreau back in time to give sulky, morose Hamlet a helping hand?
Part of the responsibility for this decision lies with his father. Hamlet was asked by his father to avenge his father's death, unless he was hallucinating. He also had a responsibility to his kingdom. So the responsibility does not lie completely with Hamlet.
This is a very interesting discussion topic. I think Hamlet resolves this dilemma to some extent by staging the play, in which he establishes beyond a doubt that Claudius is in fact guilty. In any case, I would argue that Hamlet is not exactly seeking abstract justice in the same sense that Thoreau is talking about in Civil Disobedience. Rather he is trying to gain revenge, which is a bit different. Thoreau's concept of Civil Disobedience assumes a political process by which justice might be attained. By refusing to obey an unjust law, you not only satisfy your own conscience, but highlight the injustice, which can be redressed politically. Hamlet's world was very different in that there was no political process--at least not one that Shakespeare makes us aware of--to which he could appeal. So injustice, in the end, could really only be resolved in his world through further violence.
I like your comments about the play within the play--I don't think I ever would have thought of that as an example of civil disobedience, but I think you're right. I think it's also true that Thoreau and the character Hamlet inhabit different political systems: Thoreau was thinking and writing in a democracy; Hamlet lives in a monarchy. HOWEVER--I might quibble about whether or not Hamlet wants pure revenge. I think he's after a kind of absolute justice. When he kills Claudius, he wants to be sure that he's killing him for the right reason: pure justice for an unredressed wrong, not just blood-lust and anger because he's angry about his father's murder. So on a purely ethical level, I think you have two young idealists who want to combat the evil under the sun without getting their hands dirty. Maybe Thoreau was too idealistic; maybe Hamlet's tragic flaw was to see things so darkly he no longer could find his way out.