Dramatic Foil in a play is where a person or thing that makes another seem better by contrast. Shakespeare uses this tactic is all of his plays to analyze characters. In the play "Hamlet" the character Hamlet is plagued by the death of his father and angered by the marriage of his uncle to his mother.
Shakespeare uses dramatic foil to analyze the character of Hamlet. Hamlet is saddened by the Death of his dear father. When he finds out by a visit of the ghost of his father that his Uncle Claudius murdered him. His character is conflict between these two feelings and Shakespeare uses this conflict to create the dramatic foil. Hamlet decides that he will cover his revenge of his father's death by acting crazy. This is the foil that Shakespeare uses to undermine the anger of Hamlet. Hamlet's craziness is so abrupt and realistic that no one notices his anger, not even his dearest friend Horatio. Shakespeare creates these acts of craziness with such explosive words that sometimes even the reader forgets his anger towards Claudius. This can show you how skilled Shakespeare in writing his plays. This dramatic foil also helps the reader analyze Hamlet by revealing his inner traits. His cunning behavior, quick wit, brains and planning is all revealed through his craziness. His scene with Ophelia where he detects that he is spied on shows how cautious he is. His planning of the play of the "Murder of Gonzago" shows his smarts and brains. His remarks and actions towards certain characters such as Ophelia and His Mother, Gertrude, all show that he can handle anything and has a quick wit to not uncover his anger and revenge. .
Hamlet's problems are directly parallel to the foil. Because of his revenge and anger must not be shown in his character, he must hide these feeling under something else. This is where his idea to be "Idle" comes in. he hides his real character under this shield and plays it off like nothing happened.