Did the OP give the model # of the laptop?
Is it under warranty?
How old is the battery?
A failing hardware component can cause that to happen. Most often the battery or the power block.
Also, a poor connection to the AC mains does that very thing, make the brightness go up and down.