Humour In Merchant of Venice
The Merchant of Venice is technically classified as a comedy however, it is sometimes referred to as a "problem comedy" or a "tragic comedy" because it shares features in comedies but also contains dark elements typically found in tragedies. Also, we must remember that Shakespeare's target audience was the Englishmen in the late 1500s therefore the lines that were considered humorous back then may not be considered comical now.
One way comedy is achieved is using deception and disguise or mistaken identity (scene with Launcelot and Gobbo).
Malapropism(comical confusion of words) for example Gobbo says "infection" instead of 'affection'. Also Gobbo says "defect" instead of 'effect'
Also The light and humorous tone adds levity in this play.
Another way Shakespeare makes this play comical is the idea of Jessica deceiving her father when she disguises herself as a boy and runs off to marry Lorenzo. The idea of cross dressing is again repeated later on in the play to add humour.
Shakespeare is supposedly writing about comedic characters in a comedic situation but the plot of the play, and its constant closeness to danger, forces the reader to recognise that much more is going on than what's on the surface. Characters are always hinting at their own complexity for example Shylock is cruel but also a victim of great cruelty.
The real focus of the play is prejudice and oppression of minorities, whether by gender, sexual orientation, or class. Shakespeare chooses not to deal with these issues of society in a heavy-handed way, so he comedy to add levity.