text: When Hamlet kills Polonius, Claudius recruits Rosencrantz and Guildenstern to escort Hamlet to England, providing them with a letter for the King of England instructing him to have Hamlet killed. (They are apparently unaware of what is in the letter, though Shakespeare never explicitly says so.) Along the journey, the distrustful Hamlet finds and rewrites the letter, instructing the executioner to kill Rosencrantz and Guildenstern instead. When their ship is attacked by pirates, Hamlet returns to Denmark, leaving Rosencrantz and Guildenstern to die; he comments in Act V, Scene 2 that "They are not near my conscience; their defeat / Does by their own insinuation grow." Ambassadors returning later report that "Rosencrantz and Guildenstern are dead."
  Function
  As agents of the corruption infecting the court, Rosencrantz and Guildenstern contribute to setting up the confrontation between Hamlet and Claudius. Shakespeare expects the audience to appreciate the poetic justice of their deaths: while they are very likely ignorant of the deadly contents of the letter they carry to England and are, to that extent, innocent victims of Hamlet's retaliation, they are seen as having received their just deserts for their participation in Claudius's intrigues.
  Gilbert's Rosencrantz and Guildenstern
  W. S. Gilbert's play (1874) is a comedy in which Rosencrantz plots with his friend Guildenstern to get rid of Hamlet, so that Rosencrantz can marry Ophelia. They discover that Claudius has written a play. The king's literary work is so embarrassingly bad that Claudius has decreed that anyone who mentions it must be executed. They obtain the manuscript and convince Hamlet to perform it. When he does, Claudius decrees that he must die, but is eventually persuaded to banish him to England. Rosencrantz and Ophelia can now be together.