Can I run my MacBook Pro on just AC power? I have a used little MacBook Pro 13 inch Late 2008 5,1 and I was told it needed a battery. It charges, then it doesn't, and it shuts off at the most random times, so the thought occurred to me to take the battery out and run it straight from AC power. 

It worked without a problem for a bit, then it just shut down. It would not come back on until I plugged the battery in to it.

Do I need to keep a battery in my MacBook Pro in order to run it off A/C power?
For some operations certain models require more power than the Power Supply alone can deliver at a given time. For this incident it relies on additional power from the battery. It is to be assumed that that is your machines issue. You'll probably need to get that battery replaced. The price is usually between 120-150 at an Apple Certified Repair Center in Austria. 

*My information is based on statements from AppleCare and their internal chat service for Certified Technicians.