First, in this play, Shakespeare has introduced the supernatural element in order to create an atmosphere of mystery, horror, and suspense. It diffuses an atmosphere of awe through which tragedy becomes more impressive. The appearance of the ghost in “Hamlet” chills our blood with horror, or to be more correct with terror.
The conflict is that Hamlet believes that the apparition is indeed the ghost of his father and that it has told the truth. Yet it may be a demon in his father's shape, tempting him to kill an innocent man. It told Hamlet that his father was poisoned by his brother Claudius as he slept in his orchard. The Ghost made plain the demand: "Revenge his foul and most unnatural murder". To be certain of Claudius's guilt, Hamlet decided to reenact the murder of his father with the production of The Murder of Gonzago. If Claudius was disturbed by the play it will reveal his guilt, and this was exactly what happened. Also, the ghost tells him He must not harm the Queen though she is a party to the murder and leave her to be punished by her conscience which is sure to torment her for her infidelity. Thus, the Ghost introduces an element of mystery and fear contributes to the general tragic atmosphere of the play.
The ghost's appearance had a huge mental effect on Hamlet. The lust for revenge had taken over Hamlet's mind. Every day and every moment he would only think of ways in getting revenge."So art thou to revenge, when thou shalt hear", his father leaves a psychological effect telling Hamlet that he will be thirsty for revenge when the ghost told him what had happened, and this became reality because once Hamlet came to know the truth all he would think of was revenge. Hamlet delays his action to revenge his father when he has an opportunity to kill the unattended Claudius in his chamber when he was confessing his guilt, but, after soliloquizing on the matter, he decides not to take action because Claudius is praying. Killing Claudius in prayer would not really be revenge because he would go to heaven. Then the Ghost appeared again to Hamlet. He was angry because Claudius was still alive. He told Hamlet he had returned to "whet thy almost blunted purpose". Despite the fact that the ghost was right about that Claudius had murdered his father, Hamlet continues to doubt the honesty of the Ghost. His doubts are not finally removed until the fourth scene when he sees the ghost for himself. At last, the evidence overcomes his moral reluctance to believe such foul suspicions, and Hamlet is convinced of the guilt of the king. Although Hamlet himself desires to see Claudius pay for his crime, he realizes the evil in the deed of killing the king, prompted by both "heaven and hell". The ghost has placed Hamlet in a most unnatural position by asking him to commit murder.
Hamlet kills Polonius, mistaking him for Claudius as he hides behind a curtain. Hamlet stabs Claudius and forces him to drink the poisoned wine. The revenge plot is thus concluded. Hamlet himself then dies from the wound received during the fight with Laertes. Hamlet dies by killing the murder of his father, he will be buried with the hero's glory that he has finally earned.