This question seems to infer that Hamlet is actually mad or has something that he needs to be "cured" from. One way to approach this question is to consider the various strategies that Claudius tries to employ in order to cheer his nephew/son-in-law up. Note how in Act II scene 2 he clearly tries to get Rosencrantz and Guildenstern to cheer up Hamlet, as they are his childhood friends:
I entreat you both
That, being of so young days brought up with him,
And since so neighboured to his youth and humour,
That you vouchsafe your rest here in our court
Some little time, so by your companies,
To draw him on to pleasures...
Claudius therefore tries to "cure" Hamlet by sending for some old friends of his that he can spend time with and hopefully cheer him up. As the play progresses, Claudius also tries to cheer Hamlet up by working out whether he is in fact in love with Ophelia, so that they can be married if he is. Whether Hamlet is mad or not, certainly the cause of his "distemper," as Claudius calls it, is the normal process of grief and shock at his father's death and his mother's hasty remarriage. Hamlet's response to these events is not something that is going to be "cured" quickly, but instead is something that will take time.