There’s a long thread at Apple’s discussion board about sporadic Wi-Fi failures under iPhone 3.0. It seems that the Wi-Fi eventually poops out, resulting in no Wi-Fi connectivity even inches from the router. The only fix seems to be turning off push email.
Essentially, WiFi works fine after the phone has been freshly booted (i.e. right after a restart) – however, once it has put itself into standby mode it will no longer download data over a WiFi connection after the phone is turned on again. It remains able to find the WiFi network, but simply refuses to download data over it.
This sound similar to the problems you get when trying to add unusual devices – phones, printers, etc. – to WiFi. Something in the authentication chain breaks and the connection peters out.
Sadly, none of the responders mention anything about router and iPhone models, so this is a pretty arbitrary problem. Anyone else dealing with this issue?