Question: how to know if the battery is bad or the alternator?
Answer: A simple test to check the working of the alternator is by running your car; and then unplugging the positive connection of the battery. If the car stops, then you most likely have a problem with the alternator. Another simple test is to check your interior lights.