i had the same problem, now i solved it by doing the following steps, good luck!!
1. make sure you have the latest version itunes
2. go to following link to download the latest firmware 4.2.1 http://www.iclarified.com/entry/index.php?enid=750 it's the 4th one from the bottom in the list
3. after finish download the firmware, connect you 3g iphone to itunes. once you see your phone appear in itunes, immidiately hold down "alt/commend," then click "recover" a dialog box sholud pop up, then you choose the 4.2.1 firmware you just downloaded. (your phone will appear in itunes on and off, on and off, once you see you phone shows up in itunes, you have to do the above fast!!!)
4. itunes should start process your phone and set it back to factory settings.
5. go to the link below, follow it step by step to jailbreak and unlock your 3g phone!!! http://www.iclarified.com/entry/index.php?enid=13000