Hamlet is in fact a tragic hero. According to Aristotle’s definition of tragedy, a tragic hero is a great person (often a king or some kind of royalty) who has the potential for greatness but is defeated. This protagonist (tragic hero) must come into conflict with a force directly opposed to what the hero should want (the antagonist, who in this play is Claudius). He must also suffer from a tragic flaw (a failing in his inner nature or a mistake made), which inevitably brings about his own downfall.
In Hamlet, Hamlet is the protagonist who suffers from the tragic flaw of inaction or indecision. Because of his great inability to act or to decide, more specifically to act/decide to avenge his father’s death, Hamlet dies.
Hamlet is a tragic hero in the true sense of tragedy because he died trying to accomplish his goal of avenging his father. He is a tragic hero who asked Horatio to let his story be known of how he conquered the ambitious Claudius but, in the process, lost everything he loved, including his own life.
On one level he might not be considered entirely tragic because he did not die at the hands of Claudius. Instead, he died at the hands of Laertes through Claudius's trickery. He might have been more tragic had he died at the hands of Claudius while fulfilling his prophecy to avenge his father's death.
I personally believe that Hamlet, by the end of the play, is not a truly tragic hero. Before he is sent to England by Claudius, he definitely is a tragic hero as he is constantly in a state of anxiety brought about by his false belief he must pretend to be mad to cope with his dilemma. However, once he returns to Denmark, as he looks upon the gravediggers, it is very clear he has found a place of inner peace and has become himself again. He has to wade through some horrible things before the end of the play, yes, but the essence of tragedy is not about the nature of the events which befall a hero but the state of mind he is in when they befall him.
If you read the outline of Aristotle's theory in his book POETICS for tragic heroes I believe he is a tragic hero.