In Kafka's The Metamorphosis, I have read that Kafka never wanted the bug to be associated with a cockroach, per se, but simply a bug. In fact, the cover of the original work did not have a picture of a bug at all, so as to avoid an association with one kind of insect over another. Over the years, students (and perhaps teachers) have not been able but to envision a cockroach.
The bug may symbolize a change in the man that might or might not be literal. It is suggested that it simply represents Gregor's feeling of alienation from his family, as they care more about his paycheck, and little for him.
Because the book begins with the following phrase, it has also been suggested that Gregor's change into a bug is not literal, but the element of a dream:
As Gregor Samsa awoke one morning from uneasy dreams he found himself transformed in his bed into a gigantic insect.
Dreams have, for thousands of years, been believed to be symbolic in some way. (E.g., Joseph of the Old Testament translated the dreams of Pharaoh.) In this instance, if Gregor is having a dream that he has turned into a bug, it may be symbolic of how he is perceived figuratively by his family or his employer.
To see a cockroach in your dream, symbolizes uncleanness.
However, a cockroach in one's dreams, might also symbolize things that "plague" one's life, such as worry; or something about one's personal condition that is unpleasant or negative in some way. These examples could certainly apply to Gregor's feelings about his job or the way his employer treats him, or some sense that his family tolerates him simply because he supports their leisurely lifestyle.
It is also suggested that Gregor's transformation into an insect may symbolize "the human condition."
The cockroach could symbolize "survival." It has long been said that the cockroach would be able to survive a nuclear disaster that would destroy all other life. The bug would die at "ground zero," but the truth is that this insect can withstand radiation that would kill a human—the lethal does for a human is 800 rems, whereas an American cockroach can withstand 67,500 rems: they are tough "buggers." (Pardon the pun.)
Finally, the beetle—because Kafka's insect was not meant to actually be a cockroach—can be symbolic many things. Scarabs are religious symbols, not just in Egypt, but in many cultures even older than that of the Egyptians. Beetles were worshipped for their abilities to fly or dive into the ground.
Regarding religious symbolism, Gregor is often seen as a Christ-like figure: "he felt like he was nailed down and stretched out..." when his father imbeds an apple in his back; he died at 3:00 (a.m., not p.m.); and, he sacrificed his life—almost every waking hour—for his family's well-being. Beetles were also a valuable food source. Gregor is definitely the one who provides the funds to pay for everything the Samsa family needs to survive, including food.
It is important to remember, regardless of how we interpret the image of a cockroach or beetle, that the association that seems to dominate Kafka's story is Gregor's sense of alienation, followed closely by the family's decision to lock him in his room where they eventually store unwanted household items, and ultimately, their decision to do away with Gregor…just as the charwoman disposes of his dead body—as if Gregor were trash and had never been a son or brother.