What role do Rosencrantz and Guildenstern play and what is Hamlet's attitude towards them? Why?
Rosencrantz and Guildenstern are supposedly friends of Hamlet, yet they agree to 'spy' on him so to speak in an effort to provide information to the King and Queen. They are charged by the King to discover the cause of Hamlet's transformation in personality. So, they play the part of friends while really betraying information to those Hamlet does not trust, namely Claudius and Gertrude. Rosencrantz and Guildenstern even go as far as agreeing to take Hamlet to England to be killed so that he is no longer a threat to Claudius.
Although these two are billed as friends, Hamlet shows signs that he does not trust them. After the appearance of the ghost of his murdered father, the marriage of his mother and uncle, and other disturbing events, Hamlet trusts very few people, and his 'good' friends are included. He acts mad around them, but at times provides very lucid explanations/answers, such as when he accuses them of playing him like a pipe, that seem to show that he knows a lot more of what is going on than what he is given credit for.
Hamlet's suspicious attitude toward them is simply explained by the fact that he is being 'sold out' by these two who are supposed to be his close friends.
Tom Stoppard wrote a play Rosencrantz and Guildenstern Are Dead, which is a “’worm’s-eye view of Hamlet,’” presented from the perspectives of these two minor characters.” The title of the play, of course, comes from the announcement that “Rosencrantz and Guildenstern are dead” at the end of the play, an announcement which seems minor given the deaths of all of the other characters by this point. (V.ii.371). Rosencrantz and Guildenstern never seem to be in control of their fate in Hamlet, and this is what Stoppard explores in his play. They do not know what the letter contains that they are supposed to give Hamlet, yet because of this letter Hamlet has them executed. Just as they have little control over their destiny, so Hamlet wonders about his own agency in his life, and indeed has difficulty making decisions, a hesitation to act which is the heart of the play.