Potential solution to Wi-Fi problem (at least until Apple fixed the real issue)
-------------------------------------------------------------------------------- -------------------
Wi-Fi on iOS is really horrible. So far my iPhone and Wi-Fi is working after disabling "Find my iPhone", so I didn't even need to restore the device through iTunes. But it was painful process to get it working. Originally I wanted to restore iPhone, but iTunes prevented that, because restore needs "Find my iPhone" to be disabled. However you cannot disable "Find my iPhone", if you don't have network connection.
From all this it's clear that somebody didn't think it through. It is true that "Find my iPhone" is there to prevent unauthorized user to disable this feature, so that owner could potentially find the device. I guess that's also the reason why restore of the device is prevented when "Find my iPhone" is enabled. But there has to be a better way to handle this, for example owner of iPhone could mark stolen device as "Stolen" on Apple's website and when somebody restores the phone and goes online to get updates through iTunes, it should be possbile to block the device based on it's serial number. This way "Find my iPhone" does not have to block "Restore" process.
After a little rant here is how to fix your phone, until Apple fixes real Wi-Fi problems:
Goal: The goal is to disable "Find my iPhone", which is impossible if your Wifi (or 3G/4G nework, as some users reported) does not work.
Reason: It is very likely that Find my iPhone and perhaps other services break Wi-Fi connection or networking in general. Perhaps wifi daemon cannot handle correctly parallel access to network resources.
How: You have to connect to Wi-Fi at least for a minute so you can disable "Find my iPhone".
Hint: You may need to reboot the device several times. I had to do it around 7 times, just to get wifi scanning to work.
1. Shut down your device completely by holding power button and then sliding Off switch. If that does not work, hold power button and home button until the devices shuts down. Start up your iPhone again.
2. Navigate to Wi-Fi page and try to connect to your router. If the device cannot connect or cannot find networks go to step 3. If you are connected go to step xxx.
3. On Wi-Fi settings page disable wifi by moving the switch to OFF position. This may not be as easy as it sounds. The device may continue scanning for available networks and any screen update may be very very slow. If you navigate back too soon before the information about position of the switch is saved, then the device does not actually switch Wi-Fi off and when navigating back it starts scanning again. Of course this is undesirable, because at this point networking is in bad state and it never connects. The device sometimes freezes. When I left fully charged device overnight, the battery was dead in the morning (after about 8 hours in sleep mode). Another indication of bad device state is inability to navigate back from settings while Wi-FI switch is in OFF position. Even pressing home button doesn't work and you cannot leave Settings. In this case you may need to switch Wi-Fi On again and then try to switch it OFF again. Every time you change the switch, you may need to wait (for a minute or more) so that new setting is actually applied. If nothing works and you cannot positively change the settings, you may need to go to step 1. reboot the device and repeat the steps until Wi-FI is OFF. If you finally have Wi-Fi turned OFF, navigate back and leave Settings.
4. Now that Wi-Fi is OFF shutdown the device and reboot again.
5. Navigate to Settings > Privacy > Location Services > System Services and turn off following services: Location based iAds, Share my location, Spotlight suggestions, Wifi networking and Frequent locations. It is surprising, but you actually don't need wifi networking enabled here in order to connect to wifi (if I remember it is used to provide shared access to wifi to the other services/background tasks). Disabling these services help to keep eliminate parallel requests for networking. At this point you cannot disable "Find my iPhone", because you are offline.
6. Navigate to Settings > Wi-Fi and switch Wifi ON. See if scanning works and device can find your router. If you see your router select it. If you had problems before, you may need to actually tap on ℹ icon and on DHCP tab enter into DNS field 8.8.8.8 (Google's DNS if I remember correctly). If your router is not found and you cannot see any other networks, that means the device or rather networking is in bad state, scanning is broken and you need to go to step 4 and reboot the device. If you see networks in the area including your router, select it and enter password. If the password is not accepted or you get message like "Unable to connect", you may need to repeat everything from step 4. It can also help you to configure your router to channel, which is not used by any other router that your device can see. Routers usually use default channel 11 or similar (although manufacturers now started to assign different default channel on each router). Newer routers use Automatic channel assignment. Do not use this feature, if your iOS device cannot connect even after 10 reboots. You may need to set channel manually on your router, it looks like iPhone wifi scanning has problems when more than one router uses the same channel. Hopefully by now you are connected to Wi-Fi. Proceed to step 7.
7. Before your Wi-FI connection goes down again !!! quickly !!! navigate to Settings > Privacy > Location Services > System Services and disable "Find my iPhone". The device will actually connect over the internet and disables the service online, then it disables the service on your device. If that is successful. Your Wi-Fi should be working again.
8. Optional steps: Go to Settings > Privacy > Location Services > System Services and enable Wi-Fi Networking, Frequent Locations and if you want Spotlight and iAds (although I left these off).
Good luck !!! You are going to need it.