So it sounds like you have two separate issues here.
1. The ear speaker is its own component that can be replaced, and then it will probably work again. However, I have seen some instances where replacing the ear speaker does not solve the problem. In those cases, its either a software issue, or a motherboard problem.
2. With regards to the microphone issues...there are actually two separate microphones on an iPhone 4S. The "main microphone" is at the bottom of the phone, to the left of the charge port if the screen/front of the phone is facing upward. This microphone is responsible for audio input for regular phone calls (not on speaker phone), as well as Siri and Voice Memos. The second microphone is located at the top of the phone, right next to the headphone jack where you'll see a small pin-hole in the metal frame. This microphone is responsible for audio input for phone calls using the speaker phone, recording video, and noise cancellation when using the main microphone for a regular phone call.
So in the end, it sounds like you need to replace both the ear speaker and the main microphone. Replacing the main microphone involves replacing the whole charge port flex cable, which contains the charge port, home button connector, main microphone, and loudspeaker contacts. It would be a good idea to do a software restore of the phone before replacing all this hardware though, just to make sure that it is indeed a hardware issue. Just make sure that after restoring the phone, you set it up as a new phone...don't restore to a backup as that may bring back the software issues.
I hope all that information makes sense, and is helpful.