While I love the functionality of Apple's microphone-enabled headphones (both the Apple Earphones with Remote and Mic, which comes with the iPhone 3G S, and the iPhone Stereo Headset, which came with previous iPhones), I've found that the extra layers of functionality also bring extra layers of troubleshooting when they're not working right. For simplicity sake, I'll refer to said models as "iPhone headphones" in this post (non-volume control model pictured).
The most common issues I've come across pertain to the microphone. Unlike most non-microphone enabled headphones, which use a standard two-ring TRS connector (tip, ring, sleeve), the iPhone adds an extra ring to support microphone functionality. This is what the hardcore audiophile refers to as TRRS (tip, ring, ring, sleeve).
But if your pockets are consistently filled with lint and dust (or tater tots if you happen to store them there), that extra ring won't make full contact with the iPhone's headphone jack. Which means that you, unfortunately, will lose microphone functionality.
One way to fix this is to remove any dust or lint trappings in the phone's jack. I've found that wrapping a toothpick with a thin layer of toilet paper and brushing it lightly against the walls of the headphone jack helps out a great deal. It's also important to not dip said toothpick in water or moisture. There's a moisture sensor in the iPhone's headphone jack. When exposed to moisture, it changes color and could potentially void your warranty. Also, the usual disclaimer in do-it-yourself scenarios apply: you're doing this at your own risk, so proceed with caution.