Modern electronics, especially phones laptops and tablets, use lithium-ion batteries. Li-ion batteries can only take so much abuse, and each charge and discharge cycle reduces it's overall capacity ever so slightly until it's useless. Most of the time, people wear the device out before the battery ever comes close to reaching the end of it's life. It's possible the battery in your phone was simply poorly constructed at the factory, and was doomed to live a short life.
If you have access to an identical phone (friend, family member, etc) see if your phone will function normally with their battery inserted in yours. If you don't, go pick up a multimeter at the hardware shop, they're really cheap. Use it to test the voltage of the battery, even at a very small charge level it's output rate should be constant.
There is a sticker on the battery with a series of voltage and amperage ratings. Check if these numbers match the readings of the multimeter. If they don't, or if it gives no reading at all, then you know for sure it's the battery.