I recently purchased a second hand iPhone 3G. The wifi of the device is having this problem:
After turning on the wifi, the searching circle appears for a full turn and then dissappears for 10 seconds. This continues forever and finds no networks while there ARE wireless networks in the coverage.
tried everything and eventually had to go to Apple. They ran a behaviour scan tests and told me there was a hardware fault. Had it swapped out as was still in warranty.
I recommend you do that as it is very likely to be hardware related
it may do, problem is it that its not easy to tell what exact part needs replacing. I would go to Apple if possible but as pizzafootball said, there are a few sites that will fix it for you... my guess is they will cost just as much and the work would be guarenteed.
iFixit has a good break down of how to get inside the phone though if you wanna take a crack at it yourself iPhone 3G Repair Manual - iFixit