You should restore your iPhone to 3.0 and set it up as a new phone. Upgrading a jailbroken iPhone will result in you losing 500MB of disk space due to how the JB process moves files around.
I'd recommend using redsn0w to jailbreak your iPhone, regardless if you're a Mac or Windows user. If you're a Windows user, you will need to know where your firmware image is.
If you're using Windows XP, you can find the firmware in
C:\Documents and Settings\USERNAME\Application Data\Apple Computer\iTunes\iPhone Software Updates
If you're using Windows Vista, look in
C:\Users\USERNAME\AppData\Roaming\Apple Computer\iTunes\iPhone Software Updates
After you have jailbroken your iPhone, launch Cydia and add repo666.ultrasn0w.com as a repository. From there, you can install ultrasn0w, which will unlock your iPhone. Just make sure to go into settings and disable 3G... t-mobile 3G is not compatible with the iPhone 3G chipset.