In act 1, scene 4, Hamlet meets the ghost who claims to be the ghost of his dead father. The ghost beckons Hamlet to follow it, but Hamlet's friends Horatio and Marcellus caution Hamlet and warn him that the ghost might have evil intentions. Hamlet nonetheless follows the ghost, and the ghost tells him that it is his "father's spirit," and that he, Hamlet, must "revenge his foul and most unnatural murder."
At first, Hamlet seems to trust the ghost completely, and he determines to, "with wings as swift / As meditation or the thoughts of love … sweep to [his] revenge." However, by the end of act 2, Hamlet is not so sure. He thinks to himself that the ghost "may be the devil" come to catch his soul, and he says that he will need "grounds / More relative," or more convincing than the ghost can offer before he can commit to murdering Claudius.
Hamlet's uncertainty about the ghost is likely only an excuse he gives himself so as to avoid admitting his cowardice and his depression. He seems throughout the play to be wrestling with these parts of himself. He is not a man to whom action comes naturally, and this perhaps manifests in these circumstances as cowardice. His cowardice, or his unwillingness to act, is exacerbated by his depression. While he is depressed, he lacks the spirit to take action. At the same time, the more time that goes by without action, the more depressed he becomes. Hamlet is thus trapped in this vicious cycle of depression and cowardice, one continually compounding the other.
Hamlet is much more a man of thoughts and words than he is a man of actions. This is nowhere more evident than in his soliloquy in act 2, scene 2. At this point, he berates himself for his inaction. He says that it is "monstrous" that he has not yet acted and taken his revenge. He calls himself a "dull and muddy-mettled rascal," and he asks himself, "Am I a coward?" At the end of his soliloquy, he says that he is "like a whore, unpack[ing his]heart with words" rather than taking the swift and decisive action that he initially promised the ghost he would take. As noted above, Hamlet's depression is compounded by his sense of his cowardice, and his cowardice is compounded by his depression.
At the end of the play, it is not until Hamlet's mother is poisoned and killed by Claudius that he is able to take action and kill Claudius. Arguably, if his mother had not been killed, Hamlet would have continued to procrastinate and equivocate. He likely would have continued to debate with himself whether the ghost had good or bad intentions. He likely would have continued to hesitate, trapped in a cycle of depression and cowardice.