Try the suggestions here to see if they resolve your problem:
If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.
I have tried restore and reimaging the phone several times already. I spent 45 min on a support call and even went to the store. I know they state its a HW problem, but cannot imagine there is not a simple fix. My WiFi simply stopped working over night and I have not dropped the phone, It cannot be a hardware problem, There are comments about back dating to iOS6, but has anyone tried that?
I had the same problem with my iphone 4S, ios 7.1.2. The wifi button was grayed out for some time now. I tried several methods that I found in various forums, including the reset of network settings, airplane mode, fridge and more. NOTHING!
Then I finally did what I wanted to avoid - the heating method, and it worked as follows:
1. iPhone turned on, I held a hair dryer close to it while keeping the screen on and watching it while heating the iphone with the hair dryer.
2. When the temperature warning came up on the screen, I put the iphone aside to cool up in room temperature (shut off the display). I turned it on/off couple of times until I saw that the warning was gone and normal screen came back.
3. The wifi was still grayed out.
4. I then did the network settings reset,
iphone wifi was back to normal!!