iPhone OS 3.1.3 Jailbreak using redsn0w
A lot of links are broken for jailbreaking iPhone OS 3.1.3 for the iPod Touch 1st Generation and the iPhone 2G. Here are some updated links for redsn0w and IPSWs for the iPod Touch. I also included instructions with screenshots on how to properly use redsn0w.
To begin jailbreaking, it is recommended to completely restore your iPod/iPhone to a clean version of iPhone OS 3.1.3, but it is possible that the jailbreak is successful without a restore.
Start by downloading redsn0w for your operating system. Redsn0w will likely not work on Windows computers that don't have an old enough version of iTunes. iTunes 11.0 is confirmed to work with redsn0w on Windows.
Open redsn0w and click the "Browse" button to select the 3.1.2 IPSW for your device. Despite being on 3.1.3, redsn0w requires the 3.1.2 IPSW to function.
Once redsn0w finishes verifying the 3.1.2 IPSW, you can click Next, and proceed to selecting the options for jailbreaking.
To get a bare-bones jailbreak with only a package manager (Cydia), select "Install Cydia" as the only option before proceeding to the next step. You can optionally add a custom boot logo and a recovery logo, but the image must be a png file that is less than 100kb with a resolution of 320x480 (the resolution of the original iPhone).
The final step is to place the device into DFU mode, and redsn0w provides the instructions to enter DFU mode. Once redsn0w recognizes your device in DFU mode, the jailbreak will continue, and you will see your device flash different logos and colors.
After you see "Done." in redsn0w, the jailbreak is essentially complete. The rest of the process takes place on the device.
After the running Pineapple logo finishes, the device will proceed to reboot. The running Pineapple may take a long time to complete, so be sure to be patient, and do not force reset the device unless it takes an incredibly large amount of time.
You're done! The device should be jailbroken with Cydia on the second page of the homescreen. The version of Cydia bundled is rather old, so you will have to update it.
Optionally, you can check the "Verbose boot" option in redsn0w to jailbreak the device and make the device show verbose output upon start up.