Hamlet is a play by William Shakespeare about a Danish prince named Hamlet, who feigns madness to avenge his father's murder.

The setting is at Elsinore castle in Denmark, and the mood is gloomy, as evidenced by the freezing temperatures of the first scene preceding the appearance of the ghost and the dread of war influencing the guards. The appearance of the ghost is a foreshadowing of the tragedy that is going to unfold.

In the second scene, Hamlet, the protagonist of the story, is introduced, and we find out what his relations are to the other main characters, such as his father, King Hamlet, his mother, Queen Gertrude, Horatio, his friend, and Claudius, the current king.

It is apparent that Hamlet loved his father, from his wearing mourning clothes two months after he died. He also loves his mother, not going to Wittenburg University but staying with them at the court, even though the memory of his father pains him. However, he is angry with her for remarrying only a month after his father's death and calls her inconsistent "Frailty, thy name is woman!".

Horatio is described in Act I Scene I as "Hamlet's friend". He is trusted by the prince, as is shown when he decides to go with him to see the ghost that night. Hamlet really dislikes Claudius, he thinks he is not a worthy king and not even comparable to his father. He describes Claudius as a "satyr" compared to "Hyperion", the Greek sun god (his father).

Hamlet loves Ophelia, Polonius' daughter. She reveals this to her father after her brother left, saying that "[Hamlet] of late made many tenders Of his affection to me [Ophelia]". Polonius (the chief advisor to king Claudius) says that Hamlet wants to take advantage of her by proclaiming his love to her. Laertes (her brother) thinks that Hamlet must choose a wife whom his people approve of because he will be king one day.

In Act I Scenes IV-V, Hamlet, Horatio, and Marcellus, the guard, are waiting for the ghost to appear. At its usual hour, it beckons to Hamlet to follow. His friends advise him not to go with the ghost, but Hamlet follows and finds out from it that King Hamlet, his father, was poisoned by Claudius while he was taking a nap in his garden. Hamlet swears to avenge his father, and the ghost recedes into the ground. His friends came to see what was going on, and Hamlet makes them swear not to tell anyone about the ghost.

Polonius sends a servant to France to find out what Laertes is doing by asking locals some very roundabout questions. It isn't specifically said why he wants to find these things out, but we can guess that he either intends to make sure Laertes isn't doing dumb things there or to control his son's actions.

After the servant left, Ophelia tells her father about Hamlet, who came into her room, grabbed her wrist and examined her face and then left. Polonius thinks that Hamlet is mad because he was in love with Ophelia. In fact, this presumed madness is part of Hamlet's plot to kill Claudius after finding out the truth about his father's death.

Later, Polonius tells Claudius and Gertrude about his suspicions about the nature of Hamlet's madness. They are convinced after he reads them a letter from Hamlet to Ophelia in which he expresses his love to her. Polonius decides to verify his suspicions by sending Ophelia to speak with Hamlet when he is showing symptoms of his madness and seeing his reaction.

Hamlet decides to use a play to find out whether Claudius murdered his father. When the actors arrive at the castle, he asks one of them to recite a poem about a murder, which the king tries to cut short.

One of the themes in this act is appearances vs. realities. Many of the main characters have an agenda they try to hide from everyone else. At the beginning of the act, Polonius is instructing a servant on how to find information about his son's actions in France without anyone suspecting that this is going on. Hamlet acts mad to find out whether Claudius murdered his father. Rosencrantz and Guildenstern use their friendship with Hamlet to gather information as to why he is mad for Claudius.

In Act III, Scene I, Claudius and Polonius decide to test if Hamlet's madness is caused by his love of Polonius' daughter, Ophelia. They ask her to pretend to read a book by herself in a castle corridor, and they would hide behind a curtain and be able to hear Hamlet's words to her. In an aside, we find out that what Polonius said about sugaring over misdeeds with saintly actions stung Claudius' conscience, reminding him of his crime that he was concealing (murdering King Hamlet).

They manage to hide right before he comes into the room, and Hamlet storms in, not even noticing Ophelia at first. He makes a long soliloquy about the suffering of existence and how much he wanted to die, but he decides not to kill himself because he was afraid of what would happen to him after he died. Hamlet then notices Ophelia and asks her to pray for him.

She tells him that she wanted to return some gifts he gave her, and he refuses because he said he never gave her anything. Ophelia says he gave her presents and letters which used to bring her joy, and she was giving them back. The conversation eventually leads to Hamlet informing Ophelia that he once loved her, but does not anymore. Hamlet asks Ophelia to enter a convent so she will not bear sinners into the world, and he expresses his wish for all marriage to end. Then he leaves the room.

Polonius and Claudius come out of their hiding spot and console Ophelia as she mourns Hamlet's potential vanishing because of his madness. They decide to send him to England, as he might be dangerous, but ask his mother to speak with him about his behavior.

Hamlet then attends the play he has set up. He tells the actors to perform naturally and not overdo the characters they were playing, then he goes with the rest of the court to watch the play, which consisted of the events the ghost had told him about. In the play, a king was murdered with poison poured into his ear, and the wife of the king married the poisoner. When Hamlet proclaims that in the next scene the wife of the king will marry the killer, Claudius leaves suddenly and angrily. By this, Hamlet now knows that Claudius was guilty of his father's murder.

Claudius then has a conversation with Rosencrantz and Guildenstern, telling them to take Hamlet to England, as he is too dangerous to stay in Denmark. He then tries to pray in his personal chapel, but he cannot because of his guilt at murdering his brother (we find out about this in his soliloquy). Hamlet sees him praying and decides not to kill him then because he thinks killing his uncle while he is praying will send him to Heaven.

Hamlet then goes to talk with his mother, who is instructed by Polonius to tell Hamlet that "his pranks have been too broad to bear with". Polonius would hide behind a tapestry to listen in on their conversation.

Hamlet came in and spoke with his mother, upbraiding her about marrying Claudius, and telling her he will "set you up a glass where you [Queen Gertrude] may see the inmost part of you." At this, the queen, thinking that Hamlet will murder her, cries for help, and Polonius unwisely calls for help from behind the tapestry. Hearing this, Hamlet stabs at the tapestry, killing Polonius, thinking it was his uncle.

After this, he continues to harangue his mother, saying that her marriage to Claudius is as bad as "kill a king, and marry with his brother". He sees the ghost and tells his mother about it, but she does not see it and thinks he is mad. At the end of the scene, Hamlet drags off Polonius' body with him while leaving.

In Act IV, Gertrude tells Claudius about how Hamlet murdered Polonius. The king is disturbed by this and tells Rosencrantz and Guildenstern to bring Hamlet to him and find the body. When the pair asks the prince about the whereabouts of the corpse, he does not tell them. He doesn't tell the king either after he is escorted into his office, but he gives the king a hint where it might be found.

The next day, while he is going to the ship that will take him to England (where Claudius sends him to his death), Hamlet notices Young Fortinbras' army, which had arrived in Denmark on its way to fight the Polish. He is informed that the land which Fortinbras intends to take is tiny and poor, and reflects on the fact that if people will fight so much for honor, why would he stay his hand from murdering Claudius? He decides that from now on, he would think of a way to do so.

Shakespeare uses many words and phrases that create the image of corruption, death, and disease. This is to show the corruption in Denmark's leadership (the king and queen). Some of these phrases in the first four scenes of Act IV are:

Claudius is speaking about Hamlet being: "... the owner of a foul disease" (Scene 1), referring to his "madness".
Hamlet is speaking about "a certain convocation of politic worms are e’en at him" (Scene 3), referring to Polonius' corpse being consumed by worms.
Claudius says: "For like the hectic in my blood he rages," (Scene 3) hectic refers to a hectic fever, like tuberculosis.
Hamlet, referring to Young Fortinbras' campaign to attack the Polish as a whim: "This is the imposthume [abscess] of much wealth and peace," (Scene 4).

After Hamlet leaves, Queen Gertrude is asked to see Ophelia, who went mad after her father's death. The difference between Ophelia and Hamlet is that Hamlet was just pretending to be insane, whereas Ophelia actually was. They had both lost their fathers to a murderer and were both affected by the loss.

When the queen met her, Ophelia did not respond to her questions, just sang snippets of songs, then eventually left her alone. After she left, loud noises were heard at the gate, and a guard came in, informing Claudius that Laertes had arrived from France and the people wanted to make him king.

Claudius meets Laertes, who is furious about his father's murder and blames Claudius for the tragedy. Hamlet and Laertes both blame Claudius for their fathers deaths, both are furious at Claudius and want to take revenge. Both Laertes and Ophelia are foils for Hamlet.

Then, Ophelia comes in and Laertes notices her disheveled state. After she continues her previous behavior of singing snippets and dancing around, she leaves, and Laertes is devastated because of her madness. Claudius explains that he is not the person who killed Polonius, and he would help Laertes avenge his father.

Later, a letter comes from Hamlet to his friend, Horatio, telling him of how the ship they were on was overtaken by pirates who had taken him prisoner before letting him go on the shores of Denmark. Another letter comes to the king, who is conversing with Laertes. They decide that, as Hamlet is back in Denmark, they would arrange a duel between him and Laertes, in which Polonius' son would poison his sword tip and thus kill Hamlet. If that didn't work, Claudius would give Hamlet a poisoned cup to drink from.

Hamlet is not really insane in this play, he is just pretending for various reasons. He was first feigning his madness to discover whether Claudius murdered his father, and afterward to protect himself from the king. Hamlet doesn't really appear much in these scenes because they focus on Claudius and Laertes' plot to kill Hamlet, and he is supposed to be on his way to England.

Ophelia had gone mad as a result of the death of her father. She sometimes makes sense in her singing about the death of her father. Ophelia dies of drowning in this act. Ophelia's death is a foreshadowing of the deaths of most of the other main characters in the play, as well as showing the collateral damage incurred by the evil done by the guilty.

In Act V, Scene I, two gravediggers are digging a grave for Ophelia. They talk a lot while performing their duties and concoct dark jokes. This is meant to be a comic relief before the more tragic events of the next scene. Horatio and Hamlet arrive and see the gravediggers working. Hamlet converses with one of them and thinks about how a person's personality is erased after death.

Later, Ophelia's funeral procession arrives at the graveyard. Laertes expresses his grief at his sister's death. Hamlet rushes out when he realizes they are burying Ophelia, and tells Laertes that his grief is greater than that of "forty thousand brothers". Laertes and Hamlet fight, and Hamlet swears that he will fight Laertes until his dying breath. Hamlet's reaction to Ophelia's death is extreme, but understandable. It proves that he really loved Ophelia.

In the final scene of the play, most of the main characters die. Rosencrantz and Guildenstern are killed by the English on arriving there (Hamlet forged the letters they were supposed to give to the English). Later, Hamlet is invited to a duel against Laertes. He tells Horatio that he thinks he will die in the duel.

They fight, and Hamlet manages to wound Laertes two times. Queen Gertrude drinks a toast for her son out of the poisoned cup and dies. Laertes manages to stab Hamlet with his poisoned sword, and Hamlet does the same to him.

With his dying breaths, Laertes tells Hamlet about his and Claudius' treachery, and the opponents forgive each other for the wrongs they did. Hamlet then stabs Claudius with the poisoned sword, forcing him to drink the poisoned wine before he dies. Before he eventually dies, Hamlet tells Horatio to tell everyone the truth about the events leading to his death. Young Fortinbras arrives from the victory over the Polish and is made king, as everyone else with a claim on the throne is dead. Young Fortinbras accomplished his revenge on King Hamlet by becoming the king of Denmark – it's ironic that Hamlet helped him accomplish this without knowing and, at the same time, avenging his father's death.

Hamlet has changed from the beginning of the book. He has turned from just thinking about revenge to actually performing it. This change happened in Act IV, just before he left for England, when he decided that "O, from this time forth My thoughts be bloody or be nothing worth!" This is shown in his treatment of Rosencrantz and Guildenstern – he could have just escaped instead of also planning for their murder. Hamlet is truly a tragic hero, in the sense that he is a great and virtuous character destined for downfall.