I doubt if anyone will ever build a city on top of another city, but it seems to me rather reasonable to save space by build a city that is a single giant building with many identical levels stacked one above the other for structural support.
A city in a giant building that is one hundred stories tall and occupies a ground space one mile square will have a total of 100 square miles of floor space, equal to a single story building ten miles by ten miles.
A city in a giant building that is one hundred stories tall and occupies a ground space ten miles by ten miles square (100 square miles) will have a total of ten thousand square miles of floor space, equal to a single story building one hundred miles by one hundred miles.
A city in a giant building that is one thousand stories tall and occupies a ground space one hundred miles by one hundred miles square (10,000 square miles) will have a total of ten million square miles of floor space, equal to a single story building 3,162.27 miles by 3,162.27 miles.
In short, by building a city in a giant building with many identical levels stacked one above the other for structural support, a city large enough to hold the population of an entire country, continent, or planet could be built on only a tiny fraction of the total land space, freeing the rest of the land space for other purposes such as farming, maintaining natural ecosystems, etc.