Remove the battery and then try with the AC adapter connected.
If it persists with only the AC adapter connected, replace the AC adapter. It sounds like the adapter is not providing the correct voltage to the laptop. The AC adapter may be wearing out or it may be a third-party adapter of questionable quality.
If you had a professional battery tester you may be able check the battery voltage to be sure (a local battery store or laptop repair shop may be able to do it). Without that, replacing with a known good battery to test is really the only way to be sure.
If the battery is bulging in any way then it should not be used anymore and replaced.
Failing components like a stuck fan, bad motherboard, or bad RAM could cause similar behavior. Could moisture have entered it? Check all ports and look for corrosion - if you find this you're likely looking at replacing the motherboard.