Hamlet relized that the nightgaurds have seen a ghost walking around the platform before the castle. At first he wanted to know who this ghost was:
HAMLET:... That I will speak to thee: I'll call thee Hamlet,
King, father, royal Dane: O, answer me!...
Then, when Hamlet realizes that it was his father he sense that there was a problem. The ghost need to reveal something to Hamlet. Of course you know what it is(if you read). But think about the reason why the ghost was there in the first place.It something like a revelation...that the ghost of Hamlet's father endures the most painful expierience a soul could go through...Hell to tell what happened to him and what Hamlet should do.It seems like some of the plays performed in Elizabethan era always have a divulgence of something. Do you think it is necessary to reveal a secret through supernatural means? If Shakespeare wanted Hamlet to find out about his father, he could have just written in the play a witness who saw the king's murder. Do you think that it the only way to get the point across in a play during this time?