In Shakespeare's Hamlet, Hamlet learns from the Ghost (the spirit of his dead father, Old Hamlet) that Claudius, Hamlet's uncle, is responsible for Old Hamlet's death.
In the play thus far, the audience has had no inkling that Old Hamlet was murdered. The audience can see that young Hamlet, already devastated by his father's untimely death, is not only completely surprised by the news of his father's murder, but also frantic and furious. Even without knowing the identity of the murderer, Hamlet's spontaneous response is to take immediate action:
Haste me to know't, that I, with wings as swift
As meditation or the thoughts of love,
May sweep to my revenge. (I.v.33-35)
The audience can imagine Hamlet's desire for revenge, and the Ghost has asked for it. It is at this point that the Ghost shares information about his murder, describing to his son (and the audience) what was said to have happened to Old Hamlet, and what actually took place. Though the kingdom believes that the dead king was napping in the orchard and bitten by a poisonous snake, the Ghost reveals that the only snake in the orchard was Claudius with the intent to assassinate his brother and take his crown.
At this, Hamlet is stunned. However, he does not act at that moment, but stays to listen to the Ghost, perhaps growing calmer and angrier—so his need for immediate revenge is dampened somewhat.
The Ghost describes not only Claudius' theft of the crown of Denmark, but also his theft of Gertrude's (Hamlet's mother) love. The Ghost goes on to describe the poison Claudius used and how he administered it: visiting Hamlet's sleeping father at a time when everyone knew his customary practice of napping, when he was left unguarded.
By now, Hamlet is completely horrified. His father calls for Hamlet to avenge his murder, but not to harm his mother in the process. Then the Ghost departs with the rising of the sun.
At this point, Hamlet begins to rant and rave, furious not only by what Claudius has done, but by the ease with which his murderous uncle covers up the deed—hiding behind a smile:
O villain, villain, smiling, damned villain!
My tables—meet it is I set it down
That one may smile, and smile, and be a villain;
At least I am sure it may be so in Denmark.
So, uncle, there you are. Now to my word:
It is ‘Adieu, adieu! Remember me.’
I have sworn't. (111-117)
The young prince knows that his father was murdered. He understands that his uncle is not only responsible, but he is also married now to Gertrude, and by Elizabethan standards, a brother who married his sibling's wife was committing incest. Hamlet recognizes that while Claudius may smile and fool everyone else, beneath his mask rests a villain—the murderer of his brother and his king. Hamlet now knows the truth and notes that he has given his word to his dead father's ghost—he will not forget what the Ghost has told him, and he will exact revenge upon Claudius.
As Hamlet returns to his friends, he (and the Ghost) swears them all to secrecy about seeing the spirit walking the ramparts. Hamlet then shares the truth with them. Hamlet has a conversation with Horatio, and it appears that a plan begins to form in his mind. Hamlet will, he says, avenge his father's death. However, he prepares Horatio so he will not be surprised when Hamlet begins to act insane. In this, the first act of the play, Hamlet lets Horatio (and the audience) know that from now on, he will pretend to be insane.
As I perchance hereafter shall think meet
To put an antic disposition on... (191-192)
Hamlet's "antic disposition" (pretense of madness) will give him time to find proof of the Ghost's news. We should remember that while many critics find fault with Hamlet's failure to seek revenge immediately, Hamlet must be careful. First, the Elizabethan audience believed that killing a king was a mortal sin. Hamlet does not want to jeopardize his soul. The Ghost has already shared some description of his own suffering in the afterlife because he died without the benefit of confession—and so must pay for the sins he carried to his death. The Elizabethans were also extremely superstitious: they believed that the devil could trick people into doing things that would damn them for eternity: so Hamlet needs to be certain that the Ghost is "honest," and not sent by the forces of evil to cause Hamlet to act rashly or sinfully, and lose his immortal soul.
The other difficulty is that Hamlet is now aware that he cannot be certain who he can trust. He had not suspected his uncle before. Now he can only wonder if he can trust his mother (Gertrude) or even his sweetheart, Ophelia, as well as others at his uncle's court.
Hamlet knows he must move carefully and remain one step ahead of his uncle. By behaving strangely (blamed on his pretended madness), his actions can be attributed to insanity brought on by his grief over his father's death, and remove any suspicion Claudius might have.
Hamlet says from the moment he learns of his father's murder, that he will pretend to be mad. This is part of his plan. The audience would probably agree that he does a good job of it. However, if he were truly insane, I believe Hamlet would, at some point, have lost his focus on what he needed to do for his dead father. Hamlet never does, even though it costs him the life of nearly everyone he cares about, as well as his own.