Before troubleshooting the microphone issue, make sure that you have removed any enhancement from the device, such as the headset. If the mic problem is fixed after removing the headphones, it means they need a replacement.
How to Fix the "Microphone Not Working" on Your Samsung Galaxy Device:
1. Your first action should be to remove the battery from the phone for 30 seconds and then place it back.
Turn on your phone and see if the problem is fixed.
2. If you still didn't manage to make the mic work, go on to step 3.
3. Use the recorder app on your device to record a short audio clip.
4. Replay the clip. If you can hear the sound clearly, it means that the microphone is working fine. If you cannot hear the sound well or at all, proceed to step 5.
5. Sometimes a factory reset can fix such an issue. So perform a Force Reset and see if the problem is fixed.
6. If the problem persists, it means that the microphone is damaged. You should take your device to a repair shop to get it fixed or replaced.
Source- http://www.gogorapid.com/how-to-fix-mic-not-working-on-my-phone/