I know this has been covered several time here at modmyi but i wanted to share my story.

I've had the iphone 3g for about 3 months, jailbroken since day 1 and probably rejailbroken several more times. all of a sudden the wi-fi would not connect to my home network. so i reseted the networking setting inside the iphone and still no connection. i tried to reset my router and no luck. removed the security on the router and no luck again. tried to connect to a public free wi-fi hotspot and still no avail. even tried to connect to the apple store wi-fi no luck.

restored the sucker 3-5 times. jailed iphone and still no connectivity. turned on and off the airplane mode, put a "$" in front of my password for my network and all these "tips" from the internet was not working for me. called 1800myapple and basically he was telling me everything i've already done. he scheduled me for an appointment with the "genius" bar. went to the apple store with a fresh restored iphone and voila! he exchanged it for a new 3g since i was still in warranty. I had a refurbished iphone and they come with a full 1 year warranty. my warranty still stands from the original purchase date.

so if your wi-fi is dead and you're still in warranty, restore your iphone and swap it out for a new one.