It's really odd. I just got this 3GS from my dad, who upgraded to a 4, and it has been working fine for the past week. Starting yesterday, tho, it intermittently can't detect any wifi hotspots. It'll be fine for a few hours and then it won't be able to find any wifi for the next few hours. Resetting the network settings doesn't help, nor does toggling airplane mode or rebooting the iPhone. I even tried restoring it to factory defaults and it's still having the same problem.
Is it possible to break the system by installing buggy (or malicious) jailbroken apps, to the point where a factory restore doesn't even fix the problem? Or is it a hardware issue?