Foreign visitors to China need to have a passport that is valid for at least six months beyond the expiry date of their visa. It is a good idea for anyone traveling in China to carry their passports and other relevant documents around at all times. Passports are normally needed to check into hotels, exchange money, travel by air both internally and externally and occasionally for security checks.
If you lose your passport, getting a new one takes both time and money. Take some ID and passport photos to your nearest embassy to begin the slow process of obtaining a new one. Lost passports should also be reported to the local Public Security Bureau (Gong'anju). It is advisable, for those staying in China for longer periods, to register yourself and your passport with your country's embassy. This should save time in the event of your losing your documents. It is also worth bringing a few copies of the relevant pages of your passport and any other ID that you have.