Wonder how it is like in other countries with shrinking populations. Say, Korea.
Intuitively, it would make sense for housing prices to decrease when the demand decreases, supply being equal (It's not like housing deteriorates significantly in the short term).
Japan is a bit of an outlier because of earthquake regulations.
There is a history of substantially updating building regulations every time a new record is set for largest earthquake in the modern era; and so if you are buying historical, you are buying a less safe property that could kill you.
The last major earthquake updates to the code were in 2000, so there isn’t a lot of historical housing stock without this confounding factor.
Not sure about Korea, but Japan's case is more interesting than simply adjusting for population: the government strongly incentivizes new buildings every few decades. There is also a culture of viewing housing as a consumable, which is the part that sticks out to me the most.
Demand for the big cities is still increasing pretty much everywhere, even if some countries are seeing net decrease in demand on the whole. Also remember that supply deteriorates. The number of "ready to move into" homes can decrease over time without maintenance and rebuilds.