I read this no later than 1995, but it could be from much much earlier, maybe the 70s or 80s. I thought it was called "the wall" but it's hard to search.
It was set in post-apocalypse. The earth was no longer breathable so people lived inside a giant wall, with machines called "breathers" to clean the air, and moving sidewalks that no longer worked. The main character was a girl.
At the end of the book she goes outside the wall and the earth has actually healed itself. She might have gotten out with some sort of pied piper character.
Additional aspects (added after finding the book): all the adults have died of a fever, the kids are divided into "littles" and "bigs", the main character is Kristie and her older brother Lew, the kids live in gangs called "crowds" and survive by looting what's left of the city, but food is getting more scarce, the machines have broken down and they don't know how to fix them, and the water seems to be running out, there is a "rhyming man" that leads kids out of the city, the earth outside the dome has healed itself.