I got my old 3GS replaced at an Apple Store yesterday for $80 - it was out of warranty but they said they would replace it as a battery problem. This was the second Apple Store I went to - the first tried to sell me a new battery for $150. I found an authorized Apple repair shop and they told me to go ASAP to Apple (and go to a store that wasn't as busy as the one I went to) and they should offer to replace for $50 - $100, confirming that the battery was swelling and it could explode or at least leak and damage the board. The second Apple Store was great - I did not have to throw a hissy-fit to get them to replace, just dropped a few key words like product defect; the Genius at the first store just wanted to get rid of me.
I noticed the problem when I was finally getting ready to sell the phone. I got a new iphone 5 in Nov. and had sold the phone after taking photographs of the phone in mid Jan. No bulging back and screen was clear and bright. I did notice that the phone was not holding a charge very well. Sold the phone about 10 days later and while getting it ready I noticed a dark spot on the screen, below the glass. when I pressed on the area, the spot moved. got an appt at Apple that afternoon and the Genius told me that the battery was swelling and pushing upwards and that's what caused the darkening. he opened the phone and apparently relieved some of the pressure but there was still a spot. obviously I could not sell with a known change so I checked around and found the place to replace the battery. in the 5 days between noticing the dark area and then going to get a new battery, the case started bulging. this was shocking as I was not charging or using the phone.
Took a while to find any info on battery swelling on Apple website (only here). Google 3GS battery swelling and the photos are grim - this is NOT unique problem. If your phone gets warm and the battery does not hold a charge, run, do not walk, to get the battery replaced.