One symbol found in Jeanne DuPrau's The City of Ember is the green worm Doon finds that morphs into a moth.
Early in Chapter 3, the narrator informs the reader that Doon loves collecting and studying bugs and has just recently found a new worm on a cabbage leaf and has put the worm in a box to study it. The worm symbolizes Doon's innate curiosity, the same curiosity that drives him to explore the Pipeworks to see if a solution can be found to Ember's failing generator.
Interestingly, on Lina's first day as a messenger, her job takes her to a street that has "grown deep in shadow" because bulbs in four of its streetlamps have blown out, and there are no bulbs to replace them. This realization gets her wondering what will happen once all of the bulbs in Ember's streets blow out and to picture a world of darkness. As she begins to realize the direness of Ember's situation, "a black worm of dread stirred" within her (Ch. 2). Hence, the worm also symbolizes danger and the need for change.
Later in Chapter 15, once Doon and Lina find what they think is the way out of Ember, Doon notes that his green worm had "wrapped itself up in a blanket of threads" (Ch. 15). Just as he is about to leave to meet Lina at the Pipeworks, the green worm bursts its way out of its cocoon; as the worm makes its way out, Doon thinks to himself the word egress, the very important word that led Doon and Lina to find what they think is the way out of Ember. Once the worm is out of the cocoon, Doon can see that the worm has morphed into a "moth with light brown wings" (Ch. 15). The cocoon symbolizes a place of safety, just as Ember once was, but now it is time for its citizens to make their egress, just like the worm, to reveal that they are no longer the content citizens they once were; they are now ready to spread their wings, like the moth, and reach new heights.