laptop battery can fail, or over time can lose their ability to hold a charge. If your laptop stop working, you can usually determine if a bad battery is causing the problem .you can remove the laptop battery and let the laptop work only with laptop ac adapter. If the batteryless laptop runs properly when connected to the adapter,the battery is bad. the laptop battery has most likely kicked the bucket, shuffled off its mortal coil, and otherwise become defunct.
now you should buy a new one,replacement laptop battery is cheaper but can work properly.suggest you buy a replacement laptop battery from batterywood.com.

There are several different ways to do this. What you’ll need to do is go to your Start menu; choose Control Panel, and choose Power Options. Inside the power options there’s a power meter that shows the percentage of how charged your laptop battery is. You want to charge that battery to a hundred percent, and with the laptop running you want to unplug it for ten minutes. And after ten minutes, if your battery has lost more than one percent per minute, or if it has lost more than ten percent in ten minutes your laptop battery most likely needs to be replaced. And on some newer models a quick way to test your battery is using the light meter. You press it once and it shows how charged your battery is. If you hold down the button the lights will come on and then go back off, and if they come back on the more lights that come on the more the cells are damaged. So, on this particular battery, no lights came back on so the battery is good. If all the lights came back on the battery is bad.

If the battery is bad, you will receive a warranty ID number. Use this number to see if your laptop battery is still under factory warranty. If it is, submit the request for a replacement immediately.

If the hp laptop battery is out of warranty, the screen will display that it is no longer covered.