When something is painful to touch - I would always seek Apple service - remotely or in person if that is convenient.
There are multiple safety mechanisms to prevent overheating and fire, but if there is one thing wrong - another thing could fail too and I would want to give Apple the change to fix things under warranty or exchange it if they feel it's a safety issue.
It's almost certainly the charger that's faulty - the iPad does draw a good amount of power so in a warm room, the charger can run hot and be fine, so it could be nothing at all too. Better safe and if you can borrow an infrared thermometer or use this as an excuse to spend $15-30 and buy one - it would be worthwhile to measure exactly what the case temperature is compared to ambient temperature. That would tell a lot more about whether it's within specifications or overheating.
Once you're sure the heat is normal, then you can look into the cable and maybe if there is lint covering a pin that's causing the "incompatible / non-apple detection" but that also seems to indicate a hardware issue somewhere along the chain.