Hamlet is, among other things, a ghost story. The protagonist is literally haunted by the ghost of his father, who claims to have been murdered and demands that his son seek revenge.
But that’s not all that haunts young Hamlet. Our hero grapples with questions of loyalty, love, doubt, right action, and the merits of suicide: “To be or not to be” is a pretty haunting question.
Other characters are haunted, if only for a moment, by guilt. Gertrude says to Hamlet, “Thou turns’t mine eyes into my very soul, and there I see such black and grained spots as will not leave their tinct.” And even the murderer Claudius admits privately that his “offense is rank.”
We’re all haunted, I think. Are our loyalties in the right place? Have we made the best choices in life? What have we left undone? Flannery O’Connor says in her collection Stories and Occasional Prose, “Ghosts can be very fierce and instructive. They cast strange shadows, particularly in our literature, for it is the business of the artist to reveal what haunts us.”
Shakespeare knew his business well.