The ghost of Hamlet's father, King Hamlet, reappears in Act 3, scene 4 to remind Hamlet of his purpose, not to waste time trying to get his mother's confession, but to take revenge against his uncle Claudius. .
When the ghost originally spoke to Hamlet in Act 1, scene 5; he told his son to "revenge his foul and most unnatural murder" (1.5. 25.), but "leave her to heaven" (1.5. 86.), telling Hamlet to not waste any time trying to accuse Gertrude, for she knows nothing of the heinous act. .
The ghost comes back again in Act 3, scene 4, because Hamlet has not yet carried out the request his father has made of him. Ghosts are said to haunt places because they have unfinished business, King Hamlet's business is to see his brother Claudius punished for the murderous crime he has committed. The ghost is obviously watching over Hamlet throughout the play and has seen him go through his doubts and questions whether or not the ghost is good or evil, and whether or not Hamlet should take action upon his uncle. .
The ghost has followed Hamlet into Gertrude's room and listened to their conversation and watched as Hamlet killed the snooping Polonius, and started to accuse Gertrude about her part in the murder of his father. It is then that the ghost had to reappear, to take Hamlet's anger and attention away from his mother and her connection to the murder of King Hamlet, and direct it toward whom his father intended, Claudius. The ghost of King Hamlet told his son, "But, look, amazement on thy mother sits:/O, step between her and her fighting soul:" (3.4. 110-11). The ghost achieves his purpose in this scene, which is to make Hamlet to realize it is not Gertrude he wants revenge against, and that Hamlet should not waste his time tormenting his mother, but find Claudius and follow through with his revenge. .
The ghost of Hamlet's father quickly comes in and out of the scene, but has a strong impact on Hamlet, who knows now he has no choice, but to accept his father's request, and take his revenge against Claudius.