Over the last couple days, my iPhone 3G's headphones were acting strangely. I could hear audio, but the microphone wasn't transmitting my voice and the receiver button (used to answer calls / turn MP3 player on/off) wasn't working. I assumed that it was an issue with the headphones - but after trying a second pair, I had the same issue. So clearly it's a problem with the iPhone's headphone jack. After some investigating and poking around (literally), I found a solve. And I since I realized that this is a common issue and not much is written about it... here's the solution:

First, the iPhone's headphone input apparently has a small sensor inside of it that, when covered (ie by lint), prevents the phone from activating the headphone's microphone and other functions. If you have a can of compressed air - insert it into the jack's opening and blow... making sure to tilt throughout the entire area.

If you don't have compressed air, the hack-ish solution is take your heaphones and insert it into the iPhone repeatedly and quickly. It should clear up the sensor.

I tried both solutions. The hack was precsiely that: a hack which lasted a couple hours. Once I used compressed air (and about half the can!), everything ran perfectly.