At its most basic level, the cage represents both physical and mental imprisonment. The hunger artist is put in a cage when he obtains a post at the circus. At this point, his "art" is no longer something people celebrate him for. Instead, it makes him seem like a masochist, and no one is interested in stopping to examine him wasting away in his cage. They prefer to see the animals in the menagerie. However, the hunger artist cannot change his ways, a fact emphasized by his spending his last days in a cage.
By the end of the story, the reader learns that the hunger artist does not, in fact, starve himself for the sake of art. That was never even his goal, and it was merely an excuse. Rather, he starves himself because he has never been tempted to eat:
"I always wanted you to admire my fasting,” said the hunger artist. “We do admire it,” said the overseer, affably. “But you shouldn’t admire it,” said the hunger artist. “Well then we don’t admire it,” said the overseer, “but why shouldn’t we admire it?” ”Because I have to fast, I can’t help it,” said the hunger artist. “What a fellow you are,” said the overseer, “and why can’t you help it?” ”Because,” said the hunger artist, lifting his head a little and speaking, with his lips pursed, as if for a kiss, right into the overseer’s ear, so that no syllable might be lost, “because I couldn’t find the food I liked. If I had found it, believe me, I should have made no fuss and stuffed myself like you or anyone else.”
That is, the hunger artist takes no joy from life. Because he takes no joy from life, it is no sacrifice to forego eating or other earthly pleasures. In this sense, his artistry is a sham, but he cannot escape from it. Hence, the cage in which he dies represents his inability to embrace and enjoy life. His identity, which he was previously so proud of, has only become a trap.