Welcome to Android Central! Have you been able to speak with the person who sold you the phone? This might be why that person was trying to sell it.
A few things to try:
1. Try a new or different battery. An overheating battery is often a sign that it's failing.
2. If you have an SD card inserted, it might have a corrupt file somewhere on it. Unmount the card (in
Settings>Storage), remove it, and reboot. Corrupt files can cause a device to overheat.
3. Try booting into Recovery Mode and wiping the system cache partition, which won't erase any personal data:
http://forums.androidcentral.com/sa...ing-into-recovery-mode-galaxy-s2-s3-tab2.html
4. Try booting into Safe Mode, which prevents all 3rd party apps from starting up. If the overheating stops, then it's likely that some app you installed is causing the problem.
Restart the Device in Safe Mode Samsung Galaxy S III | Verizon Wireless