Tell us what you did? Others could have the same problems as you..
It seems like it's quite a common problem with the new iOS. I just followed the instruction on one of the apple forum, but I didn't do the factory restore.
https://discussions.apple.com/message/16490677#16490677
- Check if you have MAC filtering enabled - if so disable it or add your iPhone MAC address to 'allowed' list in your router.
- Rebooting the router.
- Change the router channel from "auto" to 11.
- On the iPhone: "Forget this network" and attempt to rejoin.
- Reset the iPhone Network configuration (General -> reset -> reset network).
- Rebooted the iPhone 4S. (Also hard reset).
- Connect to an unprotected network to see if your phone connects to a different router.
- Factory restore iOS5. (don't forget to create a backup first).