See thread 2713539. You're by no means alone. Mine did it after about 7 months. It's not your fault, it's a fault with the iphone4 that Apple need to address and help their owners with. It's disgusting that owners are being charged for repairs. My understanding is that if it's within warranty, you can take it to an Apple Centre and it will be replaced with a refurbished unit immediately as there is no quick repair for this common design/manufacturing defect. I love my iphone but am not happy that outside warranty it seems you will be lucky if Apple don't just fob you off and make you pay for a hardware problem they know about but won't take liability for. I guess they're not making enough money.
Apple provides a 1 year warranty on the iPhone. If you are having a hardware problem and you are within the warranty period, you need to bring your phone to whomever provides warranty service on the iPhone in the country of purchase. If a hardware defect is found, your phone will be exchanged free of charge. If you're out of warranty (either past the one year, or if it's determined that YOU caused the damage and therefore voided the warranty), you can purchase an out of warranty exchange, which is 199.00 in the US, and roughly the same amount in other countries where the iPhone is legitimately sold.