There are several reasons for this. First of all, Hamlet argues that he does not know whether or not he can fully trust that the ghost was really his father's spirit and not just a demonish spirit trying to trick him (Elizabethans would most likely have believed this to be a possibility). This is why Hamlet sets up thje play-within-the-play to test Claudius. Once Hamlet sees teh reaction from Claudius that proves to him his uncle is, in fact, the murderer, he still delays murdering Claudius. This is mainly because he stumbles across Claudius praying and decides he can't kill him during paryer since it would possibly send him to heaven, and not to purgatoy, which is where his poor father is suffering.
Many critics argue that all this inaction is based on convenient excuses, however, that simply allow Hamlet to continue to waffle on the issue, establishing inaction and indecisiveness as character traits on his part.