You mentioned a few different things. Thank you for updating your information.
The connector to the earphones is working and you are satisfied with what you can hear through the earphones.
The pair of earphones has a microphone as part of the wire to one side of the same cord as the earphones which does not function well.
As far as you can tell, the microphone is okay when you call someone.
When you try to play back what you record, the sound quality of the microphone is unsatisfactory.
If all of this is correct, look at inside of the phone receptacle where you plug-in your microphone plug. The inside contact for one side of the microphone plug is either bent, corroded, or a piece of lint is preventing a good connection with your new earphones.
How to check:
Substitute either your phone or your new earphones with another piece of equipment. Probably it will be easier (and more sanitary) to substitute your phone at a store with a demonstrator model. If it works well with the demonstrator (or with a borrowed one), you can reasonable conclude that the problem is with your phone.
No? As the earphones are new, maybe they are faulty and can be returned where they were purchased.