There is a micro switch inside both the Audio Input and Output jacks that sometimes gets stuck. The switch is used to switch from Internal Input to External Input and if indeed is stuck, then you will not get any input from the Internal Mic. Once in awhile it can be unstuck by plugging in a mini jack plug, jiggling, twisting and unplugging. If not then the iMac will need to be taken in for service.
Also note that, the Audio Input Port is for amplified (Line Level) devices such as iPods, Stereo Receivers, etc. and it will not pickup the weak signal from an un-amplified microphone.