Hamlet's first soliloquy in Act 1, sc. 2, shows us how Hamlet is feeling at this point, before he has seen the ghost of his father. He is depressed, frustrated, and confused. He is sad that his father died and frustrated and confused about his mother's remarriage so soon to her dead husband's brother. The soliloquy in Act 2, sc. 2 shows more of Hamlet's frustration, but this time it is with himself. His father's ghost asked him to get revenge several weeks ago and he has not done anything yet. In this speech, Hamlet rails against his inaction and then decides that he'll check the authenticity of the ghost through the traveling actors and their play. In both of the speeches, Hamlet is established as one who thinks matters through and dwells upon them. We see him as one who had a happy life until his father's untimely death. He sees his own weaknesses and does not blame those weaknesses on others. He was a good, loving son to his father. Through both soliloquies, we see that he is a wronged man given a heavy burden of responsibility when asked by his father's ghost to get revenge against the murderer, his uncle. Hamlet accepts this responsibility, but also realizes that the ghost may not have been his father's spirit, so he doesn't accept matters at face value. All of this sets up Hamlet as a heroic character who will face even greater tragedy than he has already faced.
For Hamlet to be considered a tragic hero, he must fit the following criteria: He must be of noble birth, have a tragic flaw (harmatia), a moment of recognition (anagnorisis), and a downfall (peripeteia). Hamlet's first soliloquy (1.2) occurs after the marriage of his mother, Queen Gertrude, to his Uncle Claudius. Hamlet reveals his tragic flaw: his inability to act. He is upset at his mother's hasty marriage to a man beneath his father ("...no more like my father/Than I to Hercules"), but concludes that he must hold his tongue. He publicly accepts the marriage and does not speak to his mother about his feelings. Next, in 2.2 Hamlet expresses anger with himself for having not yet killed Claudius, his father's murderer. Hamlet realizes that instead of taking action he can only "unpack" his "heart with words." Hamlet resolves to "catch the conscience of the king" by watching Claudius's reaction to a reenactment of his crime at the play within the play. In the "To be or not to be" speech, Hamlet reveals that he would kill himself if only he did not fear the afterlife ("what dreams may come"). Hamlet's purpose, an "enterprise of great pitch and moment" turns "awry" and loses "the name of action." Hamlet's inability to act, his tragic flaw, has paralyzed him thus far in the play and has been interpreted as the cause of his eventual downfall.