Ophelia is Laerte's sister, Polonius' daughter, and Hamlet's love interest. In this position, she is forced to choose between a father and a brother who warn her that Hamlet's interest is merely sexual, and her own heart, which through inexperience and youth, tells her Hamlet's love was, at least once, pure.
She is, above all else, an obedient daughter, therefore, she chooses to listen to and obey her father, who has warned against having any contact at all with Hamlet. She reveals her choice when she lies to Hamlet, saying her father is at home, when, in fact, Polonius is hiding behind a curtain spying.
Much has been surmised by the somewhat secondary and certainly static character of Ophelia in Shakespeare's Hamlet. She is often looked at as a tragic character, who is a picture of innocence and purity, but due to her weakness (sometimes noted as feminine weakness and nothing more) she crumbles into insanity and ultimately kills herself. First, she is utterly devoted to her father and brother as she is growing up without her mother. However, she also wishes to be devoted to Hamlet, a man she believes loves her. The pendulum swings wide in this analysis. On one extreme, Ophelia is meant to represent women not only as weak, but blindly obedient and easily manipulated and dominated by men. But on the other extreme, she is simply innocent, pure, and a victim of circumstances she could neither control, nor hope to be equipped to handle.
Another perspective is that Ophelia is merely a secondary character whose purpose is to enhance the audience's understanding of Hamlet. Through Ophelia, Hamlet's increasingly warped view of women is revealed. He has been betrayed by his own mother, and struggles with this throughout the play. His rage against his mother is then taken out on Ophelia, which is interpreted by many as "madness." The idea that Ophelia's character is meant to be secondary is furthered by the fact that her suicide is only spoken of, as in, it never happens on stage. Further, in the scenes following, Hamlet never reveals any sadness or remorse over it. She is gone and quickly forgotten.