Hamlet knows Rosencrantz and Guildenstern were sent by the Queen and King to spy on him.
However, he still reveals true information to them, such as his eloquent speech about his deep
sadness with life and that he is only mad sometimes. Why do you think he chooses to show them
some honestly even though he knows they are spies?

(Act 2)