If you're planning to change your RMB in the airport before you leave China make sure you have a receipt for any currency exchanges or ATM withdrawals otherwise they won't exchange it. Actually I guess this is the same for any bank or exchange bureau.
We didn't realise and when we were leaving Shanghai for HK we went to the currency exchange bureau and because we'd just taken cash from ATMs during our trip we hadn't gotten any receipts so they refused

I believe it has something to do with counterfeiting.