Why does Viola decide to cut her hair and dress like a man?
Society was dominated by men and the only position available in the Duke's household was that of a manservant to the Duke. A woman certainly could not have held that position so she was required to pretend to be a man. The irony is that men were playing the roles in Shakespeare's plays so there would have been a man pretending to be a woman who is pretending to be a man. "She" would have been trying to exist in a male-dominated world much like that of England in the 16th and 17th centuries where women were merely trophies and ordered to do things by fathers, husbands, or the royals. Women were not expected to provide for themselves. Viola then has to cut her hair to fit into the male world to survive.
Viola cuts her hair and disguises herself as Cessario in order to serve Duke Orsinio. She first wanted to serve Olivia (due to how the story of love moved her [Viola]), but entered Orsinio's service to be involved in the love affair somehow.
Of course, if we look at this from the outside, she dressed like a man in order to set up the comedy that follows (and some women alone in foreign lands have disguised themselves to protect their virtue).
Viola cuts her hair and dresses like a man so that she can work for the Duke. Although the Duke originally dislikes Viola's outfit, he then hires her as a page to woo Olivia. Viola decides to go by the name of Cesario
Viola is shipwrecked off the coast of Illyria and to find work and a safe place to stay; considering she was a woman without a chaperone in a strange place she diguised herself as a man. She took the name to Cesario and became a eunuch in Orsino's household. A eunuch is a man that was castrated at a young age and never allowed to develop, which is an explantion for some her feminine features like Cesario's high-pitched voice.
So she has a place to stay and a job