While Dev-Team is waiting for iPhone 3.1 firmware to release its iPhone jailbreaking tool, geohot has released a tool ahead of them. As of this writing, the tool is available for Windows (not Windows 7). A Mac version is coming soon.
You need the latest iTunes installed on your computer. The download web site is purplera1n.com. Click on the Windows logo to download purplera1n.exe . Run purplera1n.exe on your Windows computer to jailbreak your iPhone 3GS. After iPhone reboots, run Freeze on your iPhone.