In what two ways does Hamlet disobey the ghost?
When old King Hamlet's ghost speaks with the prince, his son, he charges the prince with the task of avenging his murder. This means, really, that young Hamlet will likely have to kill the new king, Claudius, his uncle and now step-father. Old Hamlet's ghost also instructs him, saying,
"howsoever thou pursuest this act, / Taint not thy mind, nor let thy soul contrive / Against thy mother aught. Leave her to heaven / And to those thorns that in her bosom lodge / To prick and sting her" (1.5.84-88).
In other words, no matter how young Hamlet chooses to accomplish his revenge on Claudius, his father wants him to leave his mother alone and not attempt to punish her for marrying so quickly after his father's death; in addition, Hamlet should not corrupt his own mind in the process of exacting revenge on Claudius.
While Hamlet does successfully achieve his revenge on the new king, he disobeys his father's instructions in the other two respects. He does punish his mother, blaming her and treating her harshly as a result of her overhasty remarriage, and he also corrupts his mind by delaying action against Claudius for various reasons. Hamlet begins to consider himself a coward, becoming somewhat obsessed with death, and he even kills Polonius in a hasty rage.