Sync in a different computer
The easiest way of getting rid of this trouble and fixing your iPhone 3G is by synchronising it in a different computer. By this procedure, your phone can easily be synchronised with windows and new software is installed. Remember that when you connect with another computer, your devise is recognised as a new deviser and you lose all data.
Note that this process may take some time but you have to remain calm.
Sync to your computer
After the new software is installed, sync your iPhone 3G back to your computer. The computer will ask you that the device was attached to another computer and do you want to sync it to this computer, accept the option.
This method will help bring your old data and all stuff back but it also requires a lot of time so be patient.
Remember that if you disconnect your device, you will go back to restore mode.
Backup your applications
In case the first two steps fail to fix your problem and you do not have any other computer to sync with than make backup of your entire applications. Make backup of your music files, videos and applications.
Uninstall Apple components from your computer
You need to uninstall all apple software, iTunes and Quicktime from your windows and restart your computer.
Run Windows Installer Cleanup Utility
To make sure that all of Apple components have been removed, run Windows Installer Cleanup Utility. It removes all remaining components of your iPhone left in your windows.
Next download and install iTunes from apple.com. You need to get the latest version of iTunes for your computer.
Connect your phone to iTunes
Connect your iPhone 3G to iTunes after opening it. After a while, your device will be recognized and you will be asked to download the latest iPhone software.