iPhones have a few common problems that come up again and again. Cracked screens, splitting cases and dodgy headphone connections often occur but the most common problem seems to be the hardware buttons; either the sleep/power button or the home button just stop responding, or become inconsistent.
This can be caused by one of two issues: the contacts connecting the button to the motherboard being broken or misaligned, or the button itself failing. When it happened to the home button on my phone, I decided to track down the offending piece of hardware and find out the issue.
Having checked that the motherboard contacts were intact, I removed the button, and stripped it down to check the internal contacts. As you can see from the photo above, there were signs of water damage, which isn't that surprising, given how little environmental protection there is in the iPhone's design for this critical component: the plastic button actuator sits in a hole in the glass screen, and any water that gets between the glass and plastic tends to be forced into the phone through the action of the button itself. Since there is no seal or gasket to prevent it, once inside, water can easily enter the button's contacts, as they are covered with a tape that is perforated around the edges.
After removing the corrosion and applying contact cleaner, I reassembled the button, put it back in the phone and the home button worked beautifully again.