The Ghost in Hamlet claims to be Hamlet's father's spirit released from Purgatory. Is it possible that the Ghost is lying? Has it been sent from Hell to stir up mischief in Elsinore? (The play does end with a body count of eight.)
What do you think the Ghost might be lying about? Claudius definitely murdered his brother, which we find confirmed in the play-within-a-play (act 3 scene 2), and by Claudius's own confession (act 3 scene 3). However, it's true that the Ghost might not be Hamlet's father. In that case, it would still have to know the details of his father's death, and the details of his father's life. Perhaps it is some infernal spirit who has this knowledge. This is actually a very interesting question.
I think there is no definite answer to this question. It's ambiguous. But it is worth asking questions about the Ghost's intent. Consider these words from the Ghost.
I find thee apt;
And duller shouldst thou be than the fat weed
That roots itself in ease on Lethe wharf,
Wouldst thou not stir in this. (Act I Scene V)
Fathers often tell their sons or daughters what to do, and the Ghost is acting no differently. The Ghost puts quite a lot of pressure on Hamlet when he says this. In case you don't know, Lethe is a river in Greek mythology that, when drunk from, eases one of all their memories and sufferings. By making this comparison, the Ghost is goading Hamlet into action.
Now, consider the rest of the speech.
Now, Hamlet, hear:
'Tis given out that, sleeping in my orchard,
A serpent stung me; so the whole ear of Denmark
Is by a forged process of my death
Rankly abused: but know, thou noble youth,
The serpent that did sting thy father's life
Now wears his crown. (Act I Scene V)
The serpent metaphor invokes the Devil. It also makes you wonder whether it could be the Devil speaking to Hamlet. In the same way that Claudius pours poison into his brother's ear, the Ghost might be pouring poison into Hamlet's.
And now this last speech is a little unfair.
O, horrible! O, horrible! most horrible!
If thou hast nature in thee, bear it not;
Let not the royal bed of Denmark be
A couch for luxury and damned incest.
But, howsoever thou pursuest this act,
Taint not thy mind, nor let thy soul contrive
Against thy mother aught: leave her to heaven
And to those thorns that in her bosom lodge,
To prick and sting her. Fare thee well at once!
The glow-worm shows the matin to be near,
And 'gins to pale his uneffectual fire:
Adieu, adieu! Hamlet, remember me. (Act I Scene V)
First, the Ghost breaks the earth-shattering news that Hamlet's uncle killed his father. Then, he tells him not to be rash, nor let this taint his mind. But it clearly does taint his mind. After all, Christian values teach us to forgive, not to take revenge. The Ghost is advocating revenge. And that is the chief ambition of the Devil. So, if the Ghost is Hamlet's father, then he is certainly not purifying himself by coming back as a spirit and enticing his son into revenge. That's called temptation. It's fair to question whether this really is Hamlet's father. But I think the play rightfully does not focus on this question. Instead, it focuses on Hamlet's agency, given what he has heard.
In summary, the Ghost speaks truthfully about the murder of Hamlet's father, but it's ambiguous whether the Ghost actually is Hamlet's father. It could be some demon, or the Devil himself. I think it's worth asking why the Ghost says what he does, and advocates what he does. But ultimately, the play is about Hamlet's struggle to find his way out of the maze he ends up in. To revenge himself seems wrong, but not to revenge himself seems equally wrong. He has a hard predicament, and it's enlightening to see how he finally achieves peace.