I'm still on 4.1 and this is an issue for me as well. Wifi keeps disconnecting and reconnecting on it's own. Sometimes, even with my phone right beside my router, and full wifi bars, I get the message "must be connected to the internet". And either it will just hang until I quit the app and restart, or after you hit OK on the message, the app will just launch. Very quirky. What bothers me the most is when I'm downloading something and my wifi is on, sometimes it will automatically just switch to 3G. Wasting my data for no reason. I've been told that it's probably the antenna on the iP4. Which apparently has been fixed on the iP5, along with other hardware issues.
I've tried all the tips posted here and other sites, and no luck. The only thing I haven't done is replace my phone. Which more than likely won't solve it, according to Apple Genius Bar. I'm tired of having to restore my phone and reinstall all apps from scratch, so I just won't bother until iP5 comes out. Grin and bear till then. Never had any issues prior to iOS 4. Since the inception of iOS4, for me, I've had one problem after another. At least with 4.1 on the iP4, issues are minimal and bearable. Too apprehensive to update.