Find an old unneeded cell phone that uses a sim card. Break off one of the copper colored sim card contacts on that cell phone. It looks like a thin strip of metal.
After taking off the face plate of the iPhone 3G:
Bend the contact into the shape of a semi circle or a smile and slide it into the slot of the missing (broken off) sim card contact on iPhone. If you make it long enough and bend it/curve it enough it will hold itself in place. Install the iPhone sim card tray with the sim card in it and make sure the contact you installed stays in place. The sim card pressing against it will help keep it in place. Put the iPhone back together and it should work.
I had similar problem on my iPhone 3G. The iPhone 3G was working when I gave it to my wife who took out the sim card to put it in her blackberry. I didn't realize she broke it until I went through all the trouble of updating the baseband to 6.15.00 running iOS 4.2.1. I used Pwanage and Untrasn0w and then kept getting a sim card not installed error. I read a post that mentioned the a sim contact is broken or the sim card tray is not depressing a type of circuit breaker that also tells the iPhone a sim card is installed. In my case the sim card contact was broken off. No sign of it in the iPhone. I did the above and am ecstatic. I had an old broken cell phone in the house, didn't have to buy parts and was able to do it in about half an hour taking my time.
BTW: This iPhone 3G also had the wifi problem. Not sure what fixed it. Might have been when I updated it to iOS 4.2.1. Wifi now works like it was never broken. I also disconnected and reconnected the antenna before I did the update but that didn't seem to resolve the issue. Maybe it was both the reseating of the antenna and the iOS update. Who knows. Good luck!!