My MacBook battery failed a few months back. For a few weeks, my computer would go to sleep a few seconds after removing the power cord. (It could be awoken by re-attaching the power cord, and it would be in the same state as I had left it.) After a few weeks, it would shut down instantly after removing the power cord.
(Note: This happened a few months after I began heavily using a dual-boot of Ubuntu on my MacBook, as well as upgrading the Mac OS to Snow Leopard. This is a 2008 black 13-inch MacBook.)
I assumed this meant that the battery was completely shot, so I just recently got around to buying a new one. (I know, I should have dealt with this sooner.) It just arrived today—I bought it from a respected eBay seller—but it does not appear to take a charge. One thing that I have noticed is that my computer now stays on for a few seconds after removing the power cord, then goes to sleep; when I attach the power cord, I can wake it up again and it hasn't been powered down. (Just like the way my old battery acted at first.) However, my battery indicator still shows just an "X" where it should show a charge.
I've done some research and found that resetting my computer's PRAM and resetting the SMC have been known to fix these problems. However, I have done both—to no avail.
One last thing: For the past few months or so, whenever I do software update, I always have a firmware update (pictured below) that never seems to actually be applied.
I have pretty much deduced at this point that it's probably not a problem with the battery, but rather something with the computer or how the computer interacts with the battery. If someone could shed some light on this, I would be eternally grateful.