In Shakespeare's Hamlet, when Polonius is killed by Hamlet, Ophelia joins the other three "children" who suffer or have suffered the death of a parent. She joins Hamlet, Fortinbras, and Laertes in suffering the death of a parent.
Fortinbras begins an attack on Denmark, only to have his plans thwarted by King Claudius and his own uncle, the current king of Norway.
Laertes unthinkingly forces his way into Elsinore and means to kill the king, who really had nothing to do with Polonius's death, then allows himself to be manipulated by Claudius into committing treachery.
Hamlet plays god and tries to determine Claudius's eternal damnation by not killing Claudius when he thinks Claudius is confessing his sins and will therefore be forgiven of them and go straight to heaven. Hamlet's revenge results in a blood bath.
Ophelia goes mad and commits passive suicide by letting herself be drowned. Dramatically, she is one of four characters who suffer the loss of a parent, and she presents still another possible reaction to that specific type of suffering.
Incidentally, she is also dealing with being manipulated by her father, and mistreated by Hamlet, although it's important to realize that she begins the disintegration of her relationship with Hamlet by following her father's orders to deny Hamlet access to her, by returning his love letters under false pretenses, and by spying on Hamlet. Hamlet doesn't at first reject her because he associates her with his mother and all women--that comes later. He rejects her because, as always, he sees her actions for what they are--a plot to figure him out, to manipulate him, to "play" him.
Finally, I'll also throw out an additional thought. While Ophelia may, indeed, be pure and innocent, the possibility exists that she may not be so virginal as sometimes supposed. When she enters the stage, already having lost her reason, and sings her now famous song, she sings of a dead man and a deflowered maid. The dead man, of course, connects to her father, Polonius. But who is the deflowered maid? Also, when Ophelia offers up her imaginary herbs or flowers, some commentators suggest that one or two of the offerings are natural medicines used in Elizabethan England to induce abortion. In other words, one should at least consider that previous to the opening of the play, Hamlet and Ophelia had a sexual relationship.
There are a lot of opinions about what the dramatic purpose of Ophelia is in this play. An interesting theory is that her character is a foil to Gertrude. Ophelia is an innocent, virginal young woman in reality, but because Hamlet’s opinion of women in general has been warped by his mother, Gertrude, Hamlet changes from being in love with Ophelia to viewing her as a representation of her sex and therefore an unfeeling, scheming woman, callous, seeking only her own advancement.
Hamlet is conflicted about Ophelia after his father’s murder and his mother’s hasty remarriage. He knows her to be good, and he even talks about her purity and goodness, but then he remembers that she is a woman after all, and look what another woman, Gertrude, has been capable of doing. Will not Ophelia do the same thing? After his father’s death, Hamlet fears that if he pursues any relationship with Ophelia, he will be hurt in the end. These conflicting feelings cause him to act in a mean way towards Ophelia, and she is shocked because in the past, he has expressed his love for her. Everyone blames it on Hamlet’s supposed “madness” but Hamlet is depressed and when one is depressed, one’s thinking vacillates between logic and illogic – “to be, or not to be, that is the question!”
Polonius, Gertrude and Claudius use Ophelia in their attempts to find out what is wrong with Hamlet so her character also serves this purpose in the play – part of the plot. As the plot unfolds and she is no longer necessary, however, she commits suicide and disappears from the action.
Ophelia, to whom Gertrude throws "sweets to the sweet," is the sacrificial victim of the corruption of the Danish court. Throughout the play, this beautiful, innocent young lady is exploited by her self-serving father who is in constant servility to the King and Queen in hopes of advancing his career, as well as by Hamlet in his ire against the court and, particularly, his mother.
A pathetic character who serves as a foil to Polonius, Gertrude, and Hamlet alike, Ophelia represents the ideals that have been sacrificed in the "rotten" court of Denmark. For, Ophelia trusts the illusion of Hamlet's nobility in Act III--"Indeed, my lord, you made me believe so..."(3.1.115); and Polonius's wisdom in Act II--"No, my good lord, but as you did command..." (2.1.107). Poor Ophelia is but a mirror to the evils of those who rule Denmark as she furthers the motifs of disorder and illusion in the play.
One of the other purposes, in my mind, for Ophelia's madness is to further highlight the absurdity of Polonius' approach to life at court and life in general. He is so controlling of both his son and daughter, always maneuvering to try and solidify his and their position as important people at the court, that he prevents Ophelia from seeing her lover Hamlet thinking that he is only dallying with her. Too late he finds out he was wrong, and Ophelia begins to slide into madness.
This breakdown of the young and beautiful Ophelia certainly helps to show that Hamlet is a rational and feeling person but it also demonstrates the results of someone trying to control someone else's life, particularly in the rather absurd environment of the Danish court.
Ophelia's madness is a foil (a mirror, a contrast) for Hamlet's feigned (pretend) madness. While Hamlet is busy severing his ties to her in order to somehow further his own scheme to avenge his father, Ophelia suffers a mental breakdown. She goes mad, allows herself to drown (commits passive suicide), and is buried. This is what real madness looks like--not the silly and rather frivolous antics of the play-acting Hamlet.
The result of her death--due, again, to her madness--is the picture of Hamlet standing in her grave in the middle of the night shouting that he loved her and will mourn for her more than Laertes ever could.
i think her madness is just a foil to hamlets pretend madness.