I don't know what the problem is but it really sounds like a hardware issue to me if it is overheating. You should get an authorized service provider to have a look. Pretty much the only thing you could do would be to reset the device to factory settings and hope that clears up the issue, preferably using a method that completely reinstall the iOS software.
Restore your iPhone, iPad, or iPod to factory settings [with a computer] - "A factory restore erases the information and settings on your iPhone, iPad, or iPod and installs the latest version of iOS or iPod software."
Click here --> http://support.apple.com/HT201252
How to erase your iPhone, iPad, or iPod touch
"Learn how to wipe information from your iPhone, iPad, or iPod touch and restore your device to factory settings." Without using a computer. Does not reinstall iOS.
Click here --> https://support.apple.com/HT201274
If you do need to take it to an Apple service provider this will need to be in the country where you purchased the iPhone for warranty coverage.