How can I synchronize contacts with Google?

On your iPhone, you can set up an Exchange account, and enable Contacts synchronization.

Assuming you're on Mac OS X, you can also set up Google Synchronization with Address Book app and Contact synchronization with iTunes.

I've had issue with the former concerning the addresses, the city, postal code, etc. fields weren't correctly mapped. YMMV. On the plus side, the modification made to either Gmail or the iPhone are immediately applied to the other.

The second works fine for me, the downside is that you have to connect your iPhone to your computer when you want to share the modifications you made to the contacts.