If your microphone is not working there isn't anything you can do to really fix it so you will have to replace it. As you are on this site I'm sure you are quite familiar with a screwdriver and prying tool.
Follow the guide to replace the module which houses the microphone (on the left-hand side to the 30-pin dock connector) It's not a particularly easy fix but it is plain sailing once you have got past the battery.
A new module can be bought here on iFixit, on eBay or even on Amazon, won't cost you that £/$ 100 though and there isn't too much you can break apart from removing that battery which you might damage as you take it out. I'd replace that too if your iPhone is old, they are not excessively expensive either and it will improve your battery life too!
Hope this helps!