Rosencrantz and Guildenstern are almost always together. They are not differentiated or fully characterized. We think of them as rather like Siamese twins. It is impossible to tell them apart. Why did King Claudius invite two of Hamlet’s schoolmates to come to Elsinore to spy on Hamlet instead of only one? The real reason is not immediately apparent. Shakespeare invented the duo because in time they will have to stop being friendly and apply physical force—or at least the threat of physical force—against the Prince. For example, after Hamlet kills Polonius, the two young men are sent to apprehend him and bring him to the King. In Act IV, Scene 2, Rosencrantz tells him,
My lord, you must tell us where the body is, and go with us to the King.
At the beginning of the next scene, Rosencrantz tells Claudius,
Where the dead body is bestowed, my lord, We cannot get from him.
When Claudius asks, “But where is he? Rosencrantz replies:
Without, my lord, guarded, to know your pleasure.
From now on, these two erstwhile friends will act like guards. The whole purpose of having two men in these roles rather than only one is to show that Hamlet, although he is treated with respect, could be overpowered if necessary. If there was only one character guarding Hamlet, it would make Hamlet look weak. Shakespeare apparently did not want to show too many guards, but only wanted to suggest Hamlet's restrained condition after he kills Polonius. With Rosencrantz and Guildenstern keeping close watch on their old friend, it is two against one. There is a suggestion that backup is nearby if Hamlet gets out of hand. When Rosencrantz tells King Claudius that Hamlet is
Without, my lord, guarded to know your pleasure
we understand that Guildenstern must be right outside with several assistants.
Although Hamlet is apparently a prisoner, he uses his wits to dispose of his captors and regain his freedom by sending them to England with a forged letter.