City of Ember (and its sequel,
People of Sparks) are two children's books written by Jeanne DuPrau. Ember is built at some point in the near future, when some unspecified event or problem threatens to kill off the human race. The builders plan for a 200-year stay for the residents, and leave behind instructions for when and how to get out of the city. Unfortunately, one of the city's mayors tries to open the sealed instruction box early, damages it, and then hides it to cover his tracks. When the box finally opens, no one notices.
The story centers around two teens who are "graduating" from school. One wants to be a messenger because she likes to travel around the city, and the other wants to work in the generator area because he hopes he can fix it. People have been living in Ember for at least 40 years longer than the builders had planned, and the generator is failing. Supplies are running out as well, and no one has any real idea how to resolve the situation.
We read this for my homeschoolers' book discussion group, and people generally liked it.