The battery light can indicate problems with the entire charging system, so if it remains on after the battery is replaced, it may indicate a problem elsewhere in the system. Problems with the alternator are a common cause of the battery light remaining on.
The alternator produces the charge that keeps the battery going and powers the system, so problems with it can affect the whole battery system. Minor problems, including loose or broken belts, can cause the alternator to lose function. The battery light can indicate a more serious problem, such as a mechanical failure that requires a new alternator.
Other problems in the system can also cause the battery light to turn on, including loose, frayed or missing wires and plugs. Low water levels in the system may also cause it.
The problem may be with the sensor itself. Older vehicles often have a more rudimentary sensor located near the alternator, while newer cars typically use the powertrain computer to control the battery system. This can cause a light that doesn't turn off even if there is no obvious mechanical cause.
It is a good idea to check the owner's manual when the battery light comes on, because some lights may have slightly different meanings depending on the model of the car. Many automotive supply stores offer free battery testing that can help rule out a problem with the actual battery before replacing it.