5th gen ipod touch mic only works when headphones are plugged in
Following your hint on Headphone jack.

When using headphones only (no microphone) (the ones with the 2 black ring plug) the system activates the built in microphone.

When not plugged in, the system now thinks you plugged in an external microphone and it will not activate the built in one. The reason for that would be a STUCK contact pin in the jack. 

It is possible that the pin for the microphone got stuck.


Strip down a Johnson &amp; Johnson Q-tip &amp; dip it in alcohol. Insert damp Q-tip in earphone jack and twist. 
Use a compressed air can (computer store) and blow in it few times.


Do not use metal object inside the plug.

If the stuck contact pin does not get loose you have 2 choices:


use headset with microphone
open iPhone and repair the plug. (that is rather a complicated process!)