When tried to remove (settings->accounts & sync) the gmail account that was used during the initial phone setup, it erase almost anything on your phone, like contacts, photos, messages etc, and prompted this message ->
Remove accountYou can simply change, erase and register new or another Gmail account, but you have to do a Factory Reset. To do a factory reset of your phone will make you set it up again from scratch. But I have a simple tips how to remove or change your GMail account on Android Market without doing a Factory reset.
This account is required by some applications. You can only delete it by resetting the phone to factory defaults.
1. Download the application Root Explorer from Android Market
2. Once already downloaded or installed the Root Explorer,
Explore to /data/system/ and find this file : accounts.db
3. Delete that file (accounts.db)
4. Reboot your Android device.
5. Then you can register another account again.