Also, if your home button isn't working..you can always try using the Assistive Touch Virtual Home button. It works like a treat--go to iphone Settings/General/Accessibility/Assistive Touch--turn on.
If its still not working, you might want to visit the Apple Store and have it looked at. Since you have posted in iPhone 4, I am assuming that your phone is out of warranty. However, they can give you some better information about what they can do.
Same problem occurs occasionally to me. I fix it by inserting the 30 pin adapter and flexing it downward slightly. That always seems to pop the button back into use.