My experience with this issue: ear piece did not work at any time. My iPhone 5 became a speaker phone or Bluetooth only phone.
- Tried resetting the phone via holding Power and Home buttons.
- Was fully updated to the latest OS.
- No lint in the headphone jack - had tried plugging in a headset multiple times.
- Had no interest in pressing on the front or back of the phone to improve the internal connections! That would mask a manufacturing defect.
- My original December 2012 phone had been replaced by Genius Bar with a new one (this one) 3 months ago due to the original phone screen being broken so this was a very new phone.
Scheduled a Genius Bar visit. They confirmed the problem existed and told me to come back in 30 minutes while they replaced the "Receiver" (Apple-speak for the ear speaker module). I'll admit I was disappointed they were opening up my precious iPhone rather than replacing it. BTW, from the paperwork, if you replaced the ear speaker module out of warranty the cost @ Apple would be $60, installed.
Came back and they advised me the part replacement went fine, was not deeply invasive (no reheating adhesive, etc...), they claimed they made 3 test calls, 'sorry for your hassles, good bye'.
Walked out of the store and proceeded to test it by first listening to a voice mail via the ear speaker. No sound. Worked fine on speaker phone mode. Tried a phone call. Same problem, no ear speaker sound!
Walked back in the store, advised them their fix did not work, and waited in line for another 20 minutes. After confirming the phone was not fixed they advised me, sorry, 'sometimes replacing the receiver does not fix the problem'.
So they then replaced my phone with a new one. Problem (finally) solved!
PS: when you get a new replacement phone from the Genius Bar, first take the clear protector sheet off the front! I did not realize it covered both the ear speaker and mouth microphone. The resulting not-surprising lack of sound worried me the issue was in my head! ;-)