I had this exact problem as well. I think I figured out the issue...at least with mine. The key things people keep saying is that their Voice recorder and Skype applications work and I think Skype,although a great ap, is causing the problem. I use my iphone4 with updated software, had Skype installed and use it from time to time. I also use the Bluetooth in my car. I think a compatability problem exists between Skype/Blutooth/iphone intribsic software. I went to use my iphone in the car on a skype call and it kept saying "no mic available" I thought nothing of it and shut off bluetooth and it worked...Skype worked that is and about 2 weeks elapsed until my phone took a ****. The day my phone stopped working I was in the airport in Detroit and the mic just stopped working. Skype was open in the background but I was on iphone service. What I think is going on is a fight for the mic and nobody wins and it gets allocated to Skype. A reset didn't help, a new phone helped until I reloaded my backup from itunes. Once the backup was on the phone it worked for a couple of min and then stopped. I brought it to Apple and they said sorry we can't help, we gave you a new phone and it's a software issue. I restored the phone once again this time I did not install Skype and it's worked fine ever since. Perhaps some of the other tricks people suggest like making love to the headphone jack with yout earphone plug or squeezing the top of the phone works for some reason on some phones but it didn't work on mine. This is obviously a software issue and I can say that because they gave me a new iphone and it worked until I put all my aps on it then it **** the bed.
Anyway I hope this helps..I spent roughly 10 hours between 2 trips to Apple, a trip to ATT for a new Sim card and messing with it at home.
Good luck and please let me know if your issue resolves or what resolved it for you in case I encounter it again...