Possible alternator problem
Clean both battery cables and check the connections on the alternator. If it continues, go to auto zone and have the alternator checked.
Why would battery light come on then go off
Having too much play in the emergency brake handle in the middle of the console could lead to the brake light flickering. At least this was true for me.
Faulty wiring.
you may have already checked, but to me it sounds like you have a loose connection at the battery
altenator
check your wireing for a short in it or make sure the socket isn't bad and the bulb is in tight
This light is warning you that there may be a problem with your battery. Have it checked.
Because your alt is going out, when you turn the fan on for the heat/AC it draws more current,which increases the load on the alt. your alt just has not died yet....(but it will)
your Alternator
yes if one of the wires was getting an earth from the alternator cover or rubbing off the engine the battery light is really an alternator light warning you that the alternator is not charging the battery
I would unplug the battery. This will reset your clock, etc., but it should turn the light off.