Chosen Solution

The computer is not charging the battery. If you charge the battery in another computer, it will run from the battery. What part do I replace (presuming the internal battery charger is at fault)?

Yes it should run off the battery if it’s charged. What is the second computer? Test the AC power unit on the other computer if you can. If it works, the problem is probably your MacSafe board, Please don’t do anything till you tell us what the other computer is to avoid damaging both.