In William Shakespeare's Twelfth Night, Viola firmly believes that love is inconstant and irrational, and she sees clear evidence for this in the behavior of Orsino and Olivia. Viola believes, however, that she can love truly, constantly, and rationally.
Disguised as a young man named Cesario, Viola finds employment with Duke Orsino, who entrusts Viola/Cesario with wooing the Lady Olivia on his behalf.
Even while praising Orsino's love for Olivia to her, Viola recognizes the shallowness of Orsino's affections toward Olivia—Orsino is simply in love with being in love—and the overwrought expressions of his love.
VIOLA/CESARIO ...My lord and master loves you: O, such love
Could be but recompensed, though you were crown'd
The nonpareil of beauty!
OLIVIA. How does he love me?
VIOLA/CESARIO. With adorations, fertile tears,
With groans that thunder love, with sighs of fire. (1.5.236–241)
Olivia says that she cannot love Orsino and, in denying his love, tells Viola all the reasons why she should love him if she could.
OLIVIA. Yet I suppose him virtuous, know him noble,
Of great estate, of fresh and stainless youth;
In voices well divulged, free, learn'd, and valiant,
And in dimension and the shape of nature,
A gracious person: but yet I cannot love him... (1.5.243–247)
Olivia can't understand Olivia's irrationality in listing all of Orsino's positive, love-worthy traits, and then saying that she cannot love him.
VIOLA/CESARIO. If I did love you in my master's flame,
With such a suffering, such a deadly life,
In your denial I would find no sense;
I would not understand it. (1.5.249–252)
Olivia asks Viola what she would do if she loved someone.
VIOLA/CESARIO. Make me a willow cabin at your gate,
And call upon my soul within the house;
Write loyal cantons of contemned love
And sing them loud, even in the dead of night;
Halloo your name to the reverberate hills
And make the babbling gossip of the air
Cry out ‘Olivia!’ O, you should not rest
Between the elements of air and earth,
But you should pity me. (1.5.254–262)
Olivia proves Viola's belief that love is wholly irrational by falling in love with her alter ego, Cesario, at that very moment. Viola recognizes the foolishness of Olivia's sudden infatuation with Cesario, which is made even more foolish by the fact that Cesario doesn't really exist.
VIOLA. Poor lady, she were better love a dream. (2.2.25)
Despite her own belief in the fickleness and irrationality of love, Viola falls in love with Orsino, one of the most fickle and irrational characters in the play. Viola recognizes the seeming absurdity of her situation.
VIOLA. Whoe'er I woo, myself would be his wife. (1.4.44)
Viola is also aware of the love triangle in which she finds herself. Orsino loves Olivia, Olivia loves Cesario (who doesn't really exist, at least not as a man), and Viola loves Orsino.
VIOLA. ...[M]y master [Orsino] loves her [Olivia] dearly;
And I, poor monster, fond as much on him;
And she, mistaken, seems to dote on me.
What will become of this? As I am man,
My state is desperate for my master's love;
As I am woman,—now alas the day!—
What thriftless sighs shall poor Olivia breathe! (2.2.32–38)
Nevertheless, Viola remains loyal to Orsino and continues to represent him to Olivia, even though Viola is well aware that Olivia has no love for Orsino, particularly after Cesario came into her life.
Viola's love for Orsino is constant, even if somewhat inexplicable, given her feelings about love. Viola's constancy in love seems to have a positive effect on Orsino and Olivia, even though they're totally oblivious to the reality of their situation with Viola/Cesario.
Viola helps Orsino understand the futility of his lovesickness for Olivia (which is to Viola's benefit), and Viola helps Olivia to come out of her isolation and back into the world, even if the person with whom Olivia falls in love doesn't exist.
VIOLA. O time! thou must untangle this, not I;
It is too hard a knot for me to untie! (2.2.39–40)
Luckily, Time is listening, and Time does untangle the love triangle, even if the way that Time untangles it proves Viola's initial feelings about love.
When Viola reveals her true self, Orsino instantly transfers his love for Olivia to Viola.
Olivia instantly falls in love with Viola's brother, Sebastian, and transfers her love for Cesario to him. This isn't altogether unreasonable, given that Viola/Cesario and Sebastian are twins. Olivia simply swaps one for the other in her affections.