I recently saw a notice checking in: if a hotel does not properly register you as foreigner, then report the hotel to the PSB and they'll refund your room charges! Seriously.

... refund your room charges! Seriously.
That would be good news, but … the hotel may give excuse that it was caused by a temporary worker.

Until now I only was refused in Ma'erkang (where afterwards I found a really nice room in a better hotel for just 160) and in 2 places in Guizhou. In 2014 two very friendly policemen escorted me from my Nongjiayuan in the most picturesque village in the Xingyi-area into Xingyi-town, to find a hotel for me (finally I had to pay 180 for a really nice room, but I would have liked the Nongjiayuan in the village better which would have allowed me, to start the next morning in the area of my interest). They told me, that the room in the Nongjiayuan was not good enough for me as a foreigner from Europe.
Last month I was in Dafang to visit Jiudongtian and Qingxudong Arch. The first Binguan would have costed 158. But when I showed my foreign passport the lady at the reception giggled and told me to wait because she had to call somebody. Finally, I was told that it is not possible, but they would recommend me the very fancy hotel on the other side of the street. I didn't ask at the other hotel, because it seemed way to expensive (maybe I was wrong) so I asked at the next Binguan. The same story, I left before she got the answer when she called somebody. Since Dafang has many hotels around the two busstations I continued my search. A cheaper place probably would have accepted me, but I never showed them my passport because I didn't like the room. So I entered the next place, a Jiudian with a big lobby. I asked for the price: 178. OK. When I gave the girl at the reception my passport she looked at it, probably didn't like to do the paperwork and just gave me a receipt without any name on it. She also didn't make the mandatory copy of my passport. This was a diametrical experience. I thought, that probably I would get into trouble if police would stop me, but since I travel for many years in China and never had such an experience I was happy to get a room as it was already dark outside.
It does happen, though not very often, that desk clerks just take your money and hand you the key, without even asking your name. Just say "Xiexie" and quickly head to your room.
I don't think you can get in trouble with the police for staying unregistered in a hotel! After all, it's often unclear whether or not you've been properly registered. If the police want to make trouble for you in China, they don't need you staying in an unregistered hotel as an excuse.
Also, I've never had my identity checked on the street in China (only when going into train and sometimes bus stations), and have absolutely never been asked by any official where I'm staying. If you're staying unregistered somewhere, I think the worst thing that might happen to you is that the PSB will find out and come and kick you out, encouraging you to stay somewhere more expensive.
And yes, the girlfriend trick isn't foolproof - I've been refused at hotels when traveling with a girlfriend, but not very often. In fact, only ever in one town, from what I can remember.
Of course, you need to be properly registered with the PSB first if you're going to have any contact with them. Normally this is foreseeable -- usually getting a visa extension -- but not always. Say you lose your passport and need to make a police report.
I don't think you can get in trouble with the police for staying unregistered in a hotel! After all, it's often unclear whether or not you've been properly registered. If the police want to make trouble for you in China, they don't need you staying in an unregistered hotel as an excuse.
The PSB does care that foreigners are registered. If you are say living in China they might make a big deal of it, but for tourists they wont make a fuss. They will go after the hotel though
If you're staying in a place licensed to accept guests, then that place has the responsibility to register you.
If you're staying privately or in an unlicensed place, then it's your responsibility to register.
If you're staying at a hotel, and the hotel didn't register you, that's their problem. If you're staying somewhere privately and you're not registered, that's your problem.
I did once stay in a local apartment in China for awhile, and I tried to register with the PSB. They refused to register me. So instead, I just got the landlord to tell me when building inspections were, and make sure I wasn't around then.
At a hotel though, any kind of inspections are the hotel's problem, and not yours.
The one time that I KNOW I wasn't registered properly was the time in Yinchuan I mentioned earlier. I handed my passport over when I checked in only to have it immediately handed back to me (The girl barely looked at it, wouldn't have understood what she was seeing anyway and no copy taken). I asked no questions, went to my room and had no problems. And, like I say, this hotel was right next door to a fairly big police station.
There have been a few occasions when I have booked online and turned up at the hotel to be met by receptionists who have not known whether or not they are allowed to accept foreigners (Two recent occasions spring to mind. Both at branches of the 7 Days Inn. One in Jinhua, in Zhejiang; the other in Jinan, Shandong) and they've had to trundle off and talk to a manager before checking me in.
Apropos the girlfriend situation: when I lived in Tonghua and my ex-girlfriend lived in Qiqihaer, we used to rendezvous in Changchun and stay at a hotel that I know I wasn't supposed to be at. Every time we'd turn up there would always be an argument which the ex would always win (She was good at that).