sounds like your fuel pump needs to be replaced. next time it wont start, give the gas tank a little kick and try again
Why would battery light come on then go off
Sometimes yes and sometimes no, depending on what is wrong with the battery.
time for a new battery or just the cable is going bad
There is a recall that sounds similar to this issue. check bravada recalls. These are prone to having bad ignition switches
you run out of battery
The deposits resulting from corrosion create an impediment to the flow of electricity.
A capacitor that is suddenly connected to a battery will charge to the battery voltage. The time to do this is dependent on the current capacity of the battery and wiring, and the capacitance of the capacitor. This represents an instantaneous short circuit, which lasts for a (usually) very short time - but damage could be done if there was no resistance. A charged capacitor that is suddenly disconnected from a battery will hold that voltage. The length of time it will hold is dependent on how much leakage current there is.
Battery backup systems would be great in the event of power failures and outages. They would also be good to have if your main battery happens to die suddenly.
The car will stop if the battery cable comes loose.
Its unlikely that it is related to getting a new battery. Make sure that during the process of replacing the battery that any emissions hoses or wiring were not disturbed or disconnected.
Alternator
I think your battery is down or worse yet your batter charger is no longer charging the battery and hence needs replacement.