To examine the main question − whether Hamlet is a hero or an anti-hero −, we must clarify the meanings of these words.
The word "hero" has the following meanings: 1) a person noted or admired for courage, outstanding achievements, nobility, etc.; 2) a great warrior; 3) the chief male character in a poem, play, story, etc.; 4) a man of superhuman qualities, favoured by the gods (The Oxford English Reference Dictionary, 1995: 660).
The meaning of "anti-hero" is: a central character in a story or drama who noticeably lacks conventional heroic attributes (ibid, 57).
Now we can check whether Hamlet's personality fulfils the criteria of these meanings.
Is Hamlet "a person noted or admired for courage, outstanding achievements, nobility, etc."? As Samuel Taylor Coleridge claims, Hamlet is brave and not afraid of death (Fabiny 1993). According to an unknown author, Hamlet is brave and daring (2002). What evidence do we have for his bravery? He is not afraid to follow the Ghost, even though his friends warned him against doing so. He is brave enough to defy the authority of the King. But we know that the "multitude" is with him, so the King will not dare to harm Hamlet − at least not openly, and at least not for a while. He dares not to kill Claudius when the moment comes − although he knows that Claudius feels threatened by him, and will do anything to prevent Hamlet from making his secret known. He dares to talk to Gertrude in a rather "rude" way − but he knows that she is too weak and too much of a loving mother to turn against him. He dares to talk to Ophelia in a "mad" way, but it is just part of a plot − if we accept that feigning madness is a plot. He kills Polonius, but this is not bravery, rather foolishness: an action made on impulse, so insignificant that he will not even feel sorry for it. He takes the risk of going to England accompanied by Guildenstern and Rosencrantz while − as some argue − he had a guess as regards the purpose of the voyage.