1) There is a bad connection in the external power supply, its cables or the connector of the machine - gentle flexing might show you where the problem is.
2) The battery is defective and the sensing circuit that tells you it's OK is not operating correctly
- OR -
2A) the battery is not defective, the sensing circuit is working perfectly but a power connection from the battery is broken in some way.
Laptops are quite robust these days but yours may have been subject to some rough handling at some time in the past - the faults you describe sound more mechanical than component related.
Peccavi
December 2009