Now that the Beijing subway system is connecting the airport with the city that is probably the most convenient way to get to the centre of the city from the airport.
Another option is to take one of the airport shuttle buses (Y16) and at this web site you can get the detailed information for each route:
http://en.bcia.com.cn/traffic-manual/airport-bus.shtml
The most useful, Line # 2 runs 24hrs a day, departs every 15min from 8:00-22:00 after that not as frequently.
If you decide to take taxi make sure you deal with legitimate, official taxis (which have a "B" in their licence plate) which should not charge more than Y100-120 to take you to the city centre.
All those other cars that look like taxis are not (always) registered taxi cabs and they will charge two or three times the regular fare, and according to some travelers' reports one may even get robbed and/or beaten up on the way to Beijing. Be careful, don't fall a victim of a hustler who will approach you as soon as you arrive.
Public bus #359 also runs from the airport to Dongzhimen, where you can catch subway 2 or 13, but this is not very fast or convenient.
