This section of the play comes in Act I scene 4. We are told that the Ghost, when it appears before Marcellus, Horatio and Hamlet, does its best to try and beckon Hamlet to go away with it by himself. Horatio says it is as if "some impartment did desire / To you alone." From their perspective, it seems as if the Ghost wants Hamlet to be with him alone so that it can tell him something. For Hamlet, the fact that it will not speak at this stage means that he will follow it. He is obviously incredibly curious as to why the Ghost has appeared, and in particular, what news it wishes to share with Hamlet. We have been told by Marcellus already that "something is rotten in the state of Denmark," and this combined with Hamlet's grief over his father suggests that Hamlet already at some level suspects that something might not be right with the way that his father died. Thus seeing the Ghost, with the possibility that his father might not rest easy in his grave, would have made Hamlet desperate to know the truth, ready to risk anything.