Hamlet was instructed to take revenge for his father's death at the beginning of the play. How did this idea of obligation and duty to do what he was told negatively affect Hamlet?
Hamlet is negatively affected by his obligation to avenge his father's murder in a few ways. He becomes so fixated on his revenge that it becomes the only thing he can think about. We can speculate that Hamlet also gives up Ophelia, his former lover, so as to protect her as well. We can see his terrible grief for her during the scene in which she is laid to rest. He says, "I loved Ophelia. Forty thousand brothers / Could not with all their quantity of love / Make up my sum" (5.1.285-287). Perhaps he deliberately pushes her away and so gives up a potential life with her in order to fulfill his obligation to avenge his father's death.
Further, Hamlet also begins to doubt his own self-worth, his own value and faithfulness as a son. When he sees an actor play the role of Pyrrhus, Achilles's son, mourning so faithfully and exacting swift revenge on Priam, his father's killer, he is taken aback by how this actor displays more passion in his role than Hamlet seems to have displayed in his real life. He asks, "Am I a coward?" (2.2.598). He feels that he must be a coward or else he "should have fatted all the region kites / With this slave's offal" (2.2.606-607). Hamlet thinks that he would already have killed Claudius and fed his body to the birds if he weren't "pigeon-livered" himself. He constantly doubts his own fidelity as a son as a result of his obligation and difficulty in fulfilling it.
Hamlet's obligation also makes him behave in rash ways, ways that lead to the deaths of others who are innocent of wrongdoing. He murders Polonius, thinking the old man is Claudius, and he arranges for the murders of his former friends, Rosencrantz and Guildenstern, who seem to some extent ignorant of the entirety of the role they play in Claudius's schemes. Hamlet's responsibility for these deaths makes it impossible for him to escape punishment, and Laertes exacts revenge on Hamlet for Polonius's death, just as Hamlet seeks revenge on Claudius for old King Hamlet's death. This certainly negatively affects Hamlet because it leads to his own death.