A few users have reported loss of iPhone Wi-Fi connectivity after the update to iOS 4.0. In these cases, the Wi-Fi option in the iPhone’s Settings app may be grayed out.
Turn router off then on Try turning your wireless router off then back on.
Change or turn off wireless security You may want to try toggling the settings on your wireless router, switching from WPA to WEP or vice versa, or, as a last resort, turning wireless security off altogether. For AirPort routers, this can be accomplished with the AirPort Admin Utility. For other routers, this can usually be accomplished by accessing the router’s configuration page — open a browser and enter the address 192.168.1.1.
Reset network settings on iPhone. On your iPhone, open Settings, then navigate to “General” in the left-hand pane. Scroll down and tap Reset, then select “Reset Network Settings.” This will delete any stored WiFi passwords and other information, but may result in a more stable connection.
Restore, but not from a backup. One less-than-ideal fix for this issue involves restoring the iPhone as a new device rather than from a backup. It appears that bad holdover data from iPhone backups can cause loss of data access. Restoring as a new phone will delete contacts and other data, but generally resolves this problem.
To do so, connect your iPhone or iPod touch to your computer, click “Restore” in iTunes, then choose “setup as new phone.”