In Act 2, Scene 2, Viola realizes that Olivia has fallen in love with her masculine disguise and delivers a soliloquy lamenting the absurdity of her situation. This complicated soliloquy is rich with literary devices, including allusion, personification, and metaphor.
Having understood the meaning of Olivia's ring, Viola bemoans the impossibility of Olivia's love for her, which can be read as a lament about the impossibility of same-sex attraction as a whole:
Viola: Poor lady, she were better love a dream.
The relationship between Olivia and Viola can be read as an allusion to the myth of Iphis and Ianthe, which is recounted in Ovid's Metamorphoses. According to Ovid, Iphis was born in Crete to parents Telethusa and Ligdus. While Telethusa was pregnant, Ligdus resolved to kill the child if it was a girl, since he would be too poor to afford her dowry. The child was indeed born a girl, but Telethusa, with the aid of the goddess Isis, successfully concealed the baby's sex from her husband and raised her as a boy. When Iphis reached adulthood, Ligdus arranged for her to be married to a young woman named Ianthe. The two women fell deeply in love with each other, but Iphis despaired that a marriage between two women was impossible. The goddess Isis, taking pity on the two lovers, transformed Iphis into a man.
Just as Ianthe falls in love with Iphis, not knowing that she is a woman in disguise, Olivia falls in love with Cesario, unaware that she is actually Viola. And Viola, like Iphis, is symbolically "transformed" into a man when her identical brother Sebastian takes her place as Olivia's beloved.
Following this classical allusion is a reference to Christianity:
Viola: Disguise, I see thou art a wickedness
Wherein the pregnant enemy does much.
By alluding to the Devil, Viola is possibly referencing the fact that Eve, the first woman, was deceived by the serpent in the Garden of Eden. Viola may view herself in the role of the deceiving serpent, a comparison that is made more fitting by the fact that serpents are viewed as phallic symbols in some cultures.
Later in the monologue, Viola also alludes to the myth of Hermaphroditus:
Viola: And I, poor monster, fond as much on him,
And she, mistaken, seems to dote on me.
In Shakespeare's time, individuals of ambiguous sex and gender were viewed as monsters. This view comes in part from the myth of Hermaphroditus. According to Ovid's Metamorphoses, Hermaphroditus was the remarkably handsome son of the love goddess Aphrodite and the trickster god Hermes. A licentious nymph named Salmacis fell in love with Hermaphroditus, and when he rebuffed her advances, she attempted to rape him. During the assault, she begged the gods to unite the two of them forever. In response, the gods merged their bodies into one, creating the first hermaphrodite.
This myth is unusual because it depicts a woman as the lover/aggressor and the man as the beloved/victim. In Twelfth Night, Olivia actively pursues Cesario, who does not return her affections, inverting the usual gender roles of courtship.
In addition to classical and biblical allusions, Viola's soliloquy contains several instances of metaphor and personification. At one point, Viola compares women's hearts to wax, which deceitful men can easily mold:
How easy is it for the proper false
In women’s waxen hearts to set their forms!
Lamenting her predicament, which she compares to a complicated knot, she personifies Time and calls upon them for aid:
Viola: O Time, thou must untangle this, not I.
It is too hard a knot for me t’ untie.
This soliloquy also contains one important line that has been persistently misprinted:
Viola: Alas, our frailty is the cause, not we,
For such as we are made of, such we be.
In most modern versions of Twelfth Night, Viola says "OUR frailty," but in the original version of the play published in the 1623 First Folio, the line instead reads "O frailty." In the original version, Viola seems to be making a comment on the frailty of humankind as a whole, but when the line is changed to "our," she is suddenly making a comment on the frailty of women specifically. Considering the fact that Twelfth Night is populated by a number of assertive, dynamic women, it seems especially unfair that Shakespeare's words have been twisted in this manner.