All person that enter China needs to register there presence to the police within 24 hours. You dont have to think about this if you are living at a hotel, since the hotel staff is demanded to handle this issue for all there foreigner guests. They will take copy of your passport, including the visa and send it to the governments administration.
Two times I have staid in China until the very last days before my visa expire, and both time the hotel stuff contacted me and warn me about the situation. I dont know if it is the hotel it self that have this control, or it it is the police that contact the hotel.
Anyway, the hotel looks very carefully into the passport. When I should change my living last autumn, and where and bargain about the price they initially asked to see my passport. When I later use the argument that I will stay for several month in the hotel, then I got the replay:
"...but your visa expire within three weeks?"
This days I had been at the bank so I also had my other passport with me with a long term visa inside (In Sweden its OK to have two passport if you have a good reason)
This caused an even worth reaction. To have two passport seams impossible for a Chinese. The really thought that this was corrupt in some way.
I took some time to convince them, but it was a happy ending, and I have now lived here for almost a half year.

