Okay, first rule: don't replace big expensive parts just because they
might be the cause of a problem - test them first.
Next, it should be a charging system light, rather than battery light, because it indicates that the voltage is not what it should be. Again, don't assume the battery is the problem, although a bad charging system will eventually kill the battery.
Charging system problems that trigger the warning light can be due to a failed alternator, failed regulator (which is now usually built into the alternator), bad wiring, a failure in a computer which controls charging, or (rarely) a bad battery. My Ford Focus had bad connections in the wiring which caused charging problems - the alternator and battery were fine. The battery is more likely to be a victim of the problem (killed by chronic under-charging) than the cause of the problem, so if you replace it without fixing the problem you'll just need to replace it again and again.
If the warning light is going on and off while driving, it would be ideal to see the voltge while driving... that's tough with an ordinary voltmeter. There are meters which plug into a power (lighter, accessory) socket, so you can check the voltage at a glance. Once you know what is happening normally, and what happens when the light comes on, your mechanic or some of us in this forum will have more to work with to understand the situation. I use an earlier version of the
Innova Battery Monitor (but you shouldn't have to pay as much as $28 for one).