Modern audiences consider the apparition to be the "ghost of Hamlet's father," but an Elizabethan audience would not. Ghosts were spirits that could take on any shape, for any purpose; it could be angelic or satanic, and the opening scene suggests the great anxiety of the guards in not "just having seen a ghost," but in trying to comprehend what it was and what its purpose was. When Horatio addresses it, he states:
What art thou that usurp'st this time of night,
Together with that fair and warlike form
In which the majesty of buried Denmark
Did sometimes march? by heaven I charge thee, speak!
"Usurp" (from the Latin, usurpare, 'to seize for use') is the key word here -- the ghost shouldn't have disturbed the evening peace, so it has usurped "this time of night," and it has also ("Together") usurped the image of the dead king. Horatio demands it disclose its true identity and purpose. And of course, the action of the play follows the usurpation of the throne.
Asimov's Guide to Shakespeare, Gramercy Publishing, (c) 1970, pg. II-82.