The ironic character of Viola in "Twelfth Night" is clearly central to this comedy since she interacts with most of the characters. And, because of disguise, she is the one who is able to shatter the pretensions of both Olivia and Orsino.
After she arrives in Illyria after have been rescued from a shipwreck, Viola seeks her lost twin brother, Sebastian. To do this, she disguises herself as a young man, taking the name Cesario so she can seek employment under the Duke Orsino. The duke has been pursuing Olivia, who has supposedly made a vow to mourn her dead brother for seven years (I,i,23-31); to help him he elicits the aid of Viola/Cesario to "woo" her. Ironically, Viola is taken with Orsino herself. When she appeals to Olivia, the countess tells Cesario that he has made these appeals before and she is not interested. Viola/Cesario scolds Olivia for wasting her beauty:
I see you what you are, you are too proud,/But if you were the devil, you are fair./My lord and master loves you. O such love/Could be but recompensed though you were crowned/The nonpareil of beauty (I,v,238-243)
But, while Viola/Cesario speaks, Olivia finds herself falling in love with the youth Cesario. This love certainly complicates things for Viola, providing much comedic humor to the play.
In addition to the humor attached to Viola's duplicity, there is a sympathy aroused in the audience in the moments of dramatic irony in which Orsino remarks that Cesario's "small pipe/Is as the maiden's organ..." (I,iv,33). and when Feste hopes for Cesario that "he" will grow a beard: "Now Jove in his next commodity of hair send thee a beard (III,i, 44). In addition, the audience hopes that after she cures Olivia and Orsino of their artificiality Viola who has suffered quietly in her fatalistic way--
O time, thous must untangle this, not I./It is too hard a know for me t'untie (II,ii,40-41)--
will attain happiness,too. Since this is a Renaissance comedy, happiness and marriage come to Viola as Orsino turns his love to the one who has taught him the greatest loves, fidelity and friendship.