How do I restore a jailbroken iPhone 3G?
All you need to do is plug your iPhone into iTunes, click on it under Devices:



And click "Restore":



iTunes will make sure that you do actually want to restore:



Jailbreaking does not make any permanent changes; a restore will put your iPhone back exactly the way it was before you jailbroke it.