i think it depends on whether or not you want to get hacked tethering. with 3.0 or 3.0.1 you can get the tethering, but with 3.1 you can not. i believe that you can jailbreak 3.1 on the 3G but not the 3GS as of right now but i may be wrong.
if you want 3.1 just download the latest version of itunes and click check for update when the iphone is connected.
if you want 3.0 or 3.0.1 just google for the iphone 3G 3.0 or 3.0.1 direct download link and you should find it. it should start with iPhone1,2 (not 1,1 or 2,1) once you download the file, open itunes and click check for update ((WHILE HOLDING THE OPTION KEY)) and navigate to the file that you downloaded.