Hi,
If you can be heard when you are using the microphone attached to the earphones but not when you are just using the phone, it points the problem being a faulty or loose internal microphone.
One way of double checking this is to open the Sound Recorder app, record your voice for a few seconds, then play it back. If you hear nothing it definitely points to the microphone.
The microphone is located under the small paperclip sized hole at the underside of the phone. This opening ''may'' be blocked. '''DO NOT''' try to clear it by inserting anything in there, you may damage the microphone. You could try using a vacuum cleaner and just briefly hold it over the opening (it may remove any blockage) and then see if the microphone is now working. If it still doesn't work, check to see if your warranty is still valid and if so either contact the retailer or the manufacturer (depending on what your warranty states) about getting it repaired etc.