The iPhone 4S has 2 microphones. One comes as part of the dock connector and is the main microphone. The secondary microphone acts as a 'noise cancelling' mic when the phones held to your ear and acts as the main microphone when your phone is on speakerphone and when recording videos.
It sounds like you need to replace the secondary microphone. This comes as part of the headphone jack flex on the iPhone 4S.
The iPhone 4S is still under its 12 month warranty. I would highly recommend using Apple to honour this warrant before carrying out the repair yourself.