If it won't charge at all, no matter if off or on, but will run (when plugged in) then it could be either the battery or the charger. Either the battery will need replacing as it is dead, or the charger is going bad and will need replacing soon.
Now if it will charge, but only when turned off (not sleep or hibernate but powered off) and not on, then it is the charger that needs replacing.
Side note, most all batteries are replaceable. How how easily it can be done on any device is a whole other story. If it is under warranty, contact the manufacturer. If it isn't, you can try a local tech.