SO I just picked up a spare iphone 3g it came with 3.1.3 on it. SO I jailbroke it with redsnow and then unlocked it with ultrasnow. Now I would like to upgrade to 4.0. What is the process for this? do i just do it through itunes and then jailbreak and unlock it?
You can go to 4.2.1 if you'd like. If you need to unlock, you would have to go find a custom firmware for 4.2.1 made with pwnagetool without the iPad baseband since you already have an unlockable lower baseband. Find iYeow or x98car and see if they can send you a custom firmware for your device. Then you would basically just shift+restore to the custom firmware when you get ahold of it through iTunes. You can jailbreak with Redsn0w 0.9.6b6 and unlock with Ultrasn0w.
If you don't want to go through that hassle, it wouldn't hurt to stay on 3.1.3. that is the most optimized version for iPhone 3G anyway.