If it will act like it is charging when the battery is out, but not when it is in, then it may well need a new battery. Luckily they are not expensive.
Before replacing it though, you may want to check the following.
1. Check the charger port for lint, candy, dust, etc.
2. Try charging it in a different outlet.
3. Try charging via a computer USB connection rather than a wall outlet.
4. Try a diferent charger cable. If it works with a different one, then yours needs replacing.
5. If you updated anything on the phone just prior to this occurring (or installed something new) Try rolling back from the update, or uninstalling the new app.
If the prior 5 fail to fix things, then try replacing the battery.
Should none of these resolve the...