If you're able to connect to other Routers/networks, then it may be your router. Try having your internet company reset your DNS table settings, or setting them to 0.0.0.0. I work with these kinds of things everyday, and often times, it's the router. Think of it like a phonebook. Your router(name) is not matching with the DNS settings(number). resetting the DNS table settings(done by your ISP) will restore this "phonebook" to default, and should resolve any issues pertaining to the router(as it works on other phones of the same brand. If you still have the issue, and have AppleCare+(here's hoping ), then I would just get it replaced. Usually they will give you a replacement for around $3-400, WITHOUT Applecare+, but you'll definitely want to go to a store, and NOT call.
do a screenshot of the wifi connection screen and be right next to router or try turning off than on router. BTW does any other device have the some problem?