(Click the character infographic to download.)
Rosencrantz and Guildenstern seem incapable of functioning independently, so they're basically one character, no matter what they might say. They show up in Denmark to serve as paid informants on their friend from college, and they practically fall all over each other in their attempt to suck up to King Claudius. Check out their first lines:
Both your Majesties
Might, by the sovereign power you have of us,
Put your dread pleasures more into command
Than to entreaty.
But we both obey,
And here give up ourselves, in the full bent
To lay our service freely at your feet,
To be commanded. (2.2.27-34)
Uh, you've got a little something on your nose, guys.
Luckily for our amusement, they're as incompetent as they are dishonest; Hamlet sees right through them, and they make good targets for his mockery. It does seem a little harsh for Hamlet to send them off to die, though (as Horatio points out), so they point out Hamlet's weird decision-making process. He hesitates (understatement) to kill Claudius, who arguably deserves it, but doesn't flinch over exterminating his own two friends, who, let's face it, were probably just college students hard up for cash.
Even though Rosencrantz and Guildenstern die before the mass death scene in Act V, Shakespeare works it so that we find out they've been killed at the same time everyone else is dying. A British ambassador shows up in the final scene for the sole purpose of saying, "Rosencrantz and Guildenstern are dead" (5.2.411). Contemporary playwright Tom Stoppard liked this line so much that he wrote a play from the perspective of the two characters and titled it Rosencrantz and Guildenstern Are Dead.