Hamlet clearly understands that he can't trust Rosencrantz and Guildenstern after their initial conversation in Act 2. In that conversation he confronts them directly about whether they were sent for by the king and queen, and eventually they relent and tell the truth that they were, in fact, sent for. Now that Hamlet knows where their loyalty lies, he will not allow them to use him to 'score points' with King Claudius. In this scene he literally hands Guildenstern a recordeer -- a simple instrument to play. Guildenstern claims that he can't play it; he doesn't have the skill. Hamlet comes back at him and says
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; there is much music, excellent voice, in this little organ, yet cannot you make it speak.
In these lines he makes the comparison of himself to a recorder. He tells Guildenstern that if he can't make music come from a simple instrument like a recorder, he certainly won't be able to make music (information) come from Hamlet. He extends the metaphor with words like "play" -- you can play an instrument, but you can also "play" a person by getting them to do what you want them to do. The "stops" are the holes that would be covered by fingers to create different notes. To "pluck" the strings of a guitar would also create notes. To "sound" him from the lowest "note" also suggests musical notes. Hamlet even taunts him by saying that there is an "excellent voice" (with lots of information) in him, but Guildenstern is not going to be able to make Hamlet speak. He ends the conversation by saying
Call me what instrument you will (recorder or guitar), though you can fret me, you cannot play upon me.
Hamlet is making it very clear that is completely onto Guildenstern and Rosencrantz, and that he isn't going to give them anything!