* Find out what's troubling Hamlet. The King is deeply concerned about Hamlet's recent behavior, including his melancholic state, his odd behavior, and his potential madness.
* Act as spies on Hamlet. The King wants Rosencrantz and Guildenstern to subtly investigate Hamlet's thoughts and actions, essentially acting as informants. He wants them to "learn the ground" of Hamlet's "distemper."
* Distract Hamlet. The King asks them to "delight" Hamlet and "draw him on to pleasure" to see if they can help him "shake off" his melancholy. This is a subtle way of suggesting he wants them to keep Hamlet entertained and busy so he doesn't cause trouble.
The King's requests are rooted in his desire to understand and control Hamlet's actions. He fears Hamlet may be plotting against him due to his murder of Hamlet's father, and he wants to know what Hamlet is thinking and planning.