Battery icon has a question mark in it
There can be three reasons for this:


Your battery is dead or the Battery Status Indicator (BSI) pin on your battery is faulty. In either case, you have to replace the battery.
The BSI pin head on your phone hardware is faulty.
The firmware on your phone has a bug, and is unable to properly read the battery charge.


The third one is very less likely. The second option is less likely, but in my case (a Samsung Galaxy On7), both 1 and 2 had occurred at the same time.