At the beginning of “Twelfth Night” we learn that Olivia has gone into a period of deep mourning for her brother's death. She has announced that she will not leave the house or entertain any suitors for the next seven years. Olivia is motivated in part by genuine grief, but this also accomplishes two other things that are useful to her. First, she's being pursued relentlessly by the Count Orsino, who is madly in love with her and trying very hard to get her attention while he sits in his own castle in Illyria moping about how she won’t pay attention to him. By announcing that she is going into a period of mourning during which she is cutting off the possibility of romance, she is hoping that he'll get the message and simply leave her alone. Second, according to the inheritance rules at the time, she has inherited the estate where she lives from her brother because she's the only surviving child. Her parents died, and we can assume that when her father died the estate passed to her brother; when her brother died it passed to her, but only because there were no surviving male heirs. If she gets married, all of her property and money would then transfer immediately to her husband and she would once again have nothing of her own. In order to hold on to her own fortune and her own property and be able to be to make independent decisions about her life and her money, she needs to remain single. By avoiding men, she is also protecting her property rights. All those reasons are true for Olivia at the same time: she is genuinely grieving for the loss of her brother, mourning provides an excuse to be rid of the annoying Orsino, and also helps her protect her property, which she would have to give up if she married.