I just received my replacement iPhone 3G as the previous one had its WiFi decide to stop working only hours after the 3.1 firmware update.
==============================================
The history:
It happened at a friends place. I connected to his WPA WiFi network, attempted to use "Remote" to vote for a song on his iTunes DJ, then the phone dropped the wireless connection and that was the end of my Wifi.
In my case it was the WiFi option in "Settings" being greyed out and unavailable. In the "About" section, it would sometimes list a WiFi mac address and sometimes not.
==============================================
Ok, and back to today's adventure:
As the replacement still had the 3.0 firmware on it, I had to update it to 3.1.2 so as I could restore my backup.
After the update, the Wifi is still working (kind-of)...
I can start Safari and the iPhone will ask me which network I want to use. It will quite happily connect, but after that it will continue using the 3G data and no WiFi icon appears in the top left corner.
I have to switch Airplace Mode on, connect to my Wifi and then turn Airplane back off.
At least I actually HAVE some kind of WiFi now...