-
If you control the WiFi network, then download the app "WiFi Analyzer".
The vast majority of WiFi issues can be resolved by simply moving the frequency (channel) of the WiFi network to a clean bit of the spectrum. Most WiFi routers shipped by people like BT, Virgin Media, etc only choose 1 of 3 channels (even though 14 channels are available) and as such in dense housing they will all conflict.
Lollipop on Nexus 5 seems to periodically screw up my wifi as well.
Wifi is connected but my phone thinks it's offline and shows no internet connection, although because it has wifi connected it also won't use the 4G. It makes using things like whatsapp a bit of a gamble. (I'm currently pondering using tasker to ping something and turn off wifi if it doesn't work but it's a faff to sort out an annoying bug.)