After Hamlet discusses Claudius's behavior during the play, Rosencrantz and Guildenstern arrive to inform Hamlet that his mother would like to speak with him. Rosencrantz and Guildenstern then attempt to persuade Hamlet to divulge the reason for his behavior, which prompts Hamlet to pick up a recorder and beg Guildenstern to play it. Guildenstern goes on to tell Hamlet that he doesn't know how to play the recorder and Hamlet responds by saying,
Why, look you now, how unworthy a thing you make of me! You would play upon me. You would seem to know my stops. You would pluck out the heart of my mystery. You would sound me from my lowest note to the top of my compass. And there is much music, excellent voice, in this little organ, yet cannot you make it speak? 'Sblood, do you think I am easier to be played on than a pipe? Call me what instrument you will, though you can fret me, yet you cannot play upon me (Shakespeare, 3.2.393-402).
Hamlet is using an analogy by comparing Rosencrantz and Guildenstern's efforts to manipulate and deceive him to the way a musician plays an instrument in order to make particular sounds. Hamlet is aware that his "friends" are working for Claudius and Gertrude and refuses to give them their desired answers concerning the real reason he has been acting like a madman. Essentially, Hamlet is telling Rosencrantz and Guildenstern that he will not be played like an instrument, which is another way of saying that he will not be manipulated or deceived into giving them valuable information that they will undoubtedly share with Claudius.