Question: how do you know if your iphone needs a battery replacement?
Answer: Go to Settings > Battery and, if it's in bad enough shape, you'll see a notification at the top of that screen that says your battery needs to be serviced. Take your phone to the nearest Apple Store for a battery replacement (third-party repair shops may charge less).