I would stay in town in order to get an early start.
Try to get to the Temple of Heaven early (like before 7am). Next head to the Forbidden city. You need to head to the airport before 2pm (earlier if you need to get your luggage). If you still have time when you exit the FC you can climb Jingshan just across the street or head to the Drum Tower area.