The two plays you will write about both use disguise but in very different ways. In As You Like It, disguise is mostly literal, as Rosalind dresses up as a young man, Ganymede. In Hamlet, disguise is primarily figurative, as Hamlet feigns madness.
The task in effectively comparing two such different approaches is to find commonalities between them. You could look at the reasons the two characters decide to fool the people around them. You might also address the outcomes of their deception. Another angle would be to interpret the language the two disguised characters use. How does "being" a man affect the way Rosalind speaks? What does Hamlet say when he is acting as though he is mentally ill?
As You Like It is a comedy, and Hamlet is a tragedy so the outcomes are quite different. Because Shakespeare is moving the action toward a different resolution in each play, the steps along the way are quite different as well. Rosalind enjoys teasing Orlando while she is disguised, but no great harm comes to either one--they fall in love, once she is back to dressing like a woman, and become a couple. In Hamlet, however, his goals in feigning madness include wreaking a terrible revenge on his uncle. While he does succeed, in that Claudius dies, he manages to kill a large number of other people along the way so the effects of disguise are very far from those that Rosalind caused.