Often there is a soft button on the battery, which will cause a light sequence to begin when depressed. Google your laptop's site and there is normally a "decoder" for the light sequence, which should give you an idea as to your battery's condition. If the battery is new and faulty, try getting it exchanged (though the warranty period isn't normally very long), otherwise you'll need a new one.
If the battery is OK, then it could be the charging circuit in the machine or you could have the power settings on something like "Maximum Battery Life", which will shut down the laptop if left untouched for more than a few minutes.
It's fine to run your laptop off the mains.