Wi-Fi settings grayed out on iPhone
this is the only guide that worked for me : http://smarttechtips.blogspot.com/2013/12/how-to-fix-grayed-out-wifi-on-iphone.html

here is a summary of what you are going to do :D : 


you will have to jailbreak your device first.
enable cellular data and install openSSH, afc2add (those 2 apps are around 4  megabytes only)
install an app called ispirit on your pc and then connect your device.
install macfixer on your phone using ispirit , then restart cydia and install essential updates
(you will find an update for macfixer, install it )
restart your phone.
if this didn't work then try the hair dryer method first , (only heat the specified parts for 3-4 minutes or till you get the message that says 'your phone is too hot....') then reapply this guide again.
hope this helps :D