The Metamorphosis, by Franz Kafka, is the story of one unfortunate man, Gregor Samsa, who is mysteriously turned into a bug (cockroach) one night. Gregor's life is miserable at the beginning of the novella, and it does not substantially improve during the course of the story, when Gregor finally dies.
Gregor is loyal to his family but is entirely unhappy the morning he wakes up as a bug--and his unhappiness has very little to do with the fact that he is now a bug. He hates his job as a travelling salesman, but it seems to be the only thing he has to do with his life. His family takes advantage of him, allowing him to support them and pay all their bills while they enjoy lives of relative luxury and idleness. Though he does resent them for this, he dutifully works a job he hates in order to allow them to continue their life of ease. Gregor does not appear to have any real friends, and his boss clearly only cares for Gregor because he is productive. It is not surprising that Gregor is unhappy and dissatisfied with his life.
As the story continues and Gregor is forced to remain confined to his room, he begins to grow resentful. As the restrictions and abhorrence toward him grow, so do his resentment and fear. His father beats him and his sister clearly abhors his physical condition, both of which cause his resentment and anger to grow.
Twice Gregor seems to undergo a somewhat positive change which affects his mood. The first is his unwillingness, despite the sense of duty to family he clearly feels, to allow his sister to take his belongings. This is the only time Gregor puts his own needs ahead of his family's needs; however, he loses the battle. The second instance in which Gregor's mood changes is when he allows himself to be lured out of his room by the balm of his sister's violin playing. Though he experiences a temporary respite from his gloomy and pitiful circumstances, he is punished for this act; this punishment is directly correlated to Gregor's death.
In short, Gregor is generally despondent and unhappy throughout the story, and he has many reasons to feel the way he does. Perhaps if he had been less self-sacrificing and dutiful to his family, Gregor might not have ended up as a victim of their selfishness.