Foreigners staying in a hotel, guesthouse, school or other commercial, non-profit, government or other facilities after arriving in Beijing need to produce a valid a passport or residence certificate and fill out a Temporary Lodging Registration Form.
For a foreigner staying at the residence of his relatives or friends after arriving in Beijing, the host or the foreigner shall register at the local police station with the host's residence card, the foreigner' valid passport and other valid identification documents and fill out a Temporary Lodging Registration Form within 24 hours (72 hours in rural areas) after his arrival.
If a foreigner with a residence permit leaves his residence and lives temporarily in another place, he needs to fill out a Temporary Lodging Registration Form at the places of his temporary stay.
If a foreigner travels an area that is not opened to foreigners, he must produce his valid passport or residence permit and fill out a Temporary Lodging Registration Form as well as a travel permit.
If a foreigner stays in a foreign institution in China or another foreigner's residence in Beijing, the host or the foreigner must register at the local public security organ with his passport or residence documents and fill out a Temporary Lodging Registration Form within 24 hours of his arrival.
(english.gov.cn)