I’ve (belatedly) updated my iPhone 3g’s OS today. Just after the update, it started to heat up, and was not recharging no matter how long it was left on the charger. Restarting (hold down the home and the power buttons simultaneously for about 10s) seems to fix both issues.
First law of IT support – try restarting the bloody thing.
Further to the above, if your iPhone battery is draining itself at an alarming rate, try to switch off Push (Settings > Mail, Contacts, Calendars > Fetch New Data). This has stopped my battery from draining itself every few minutes.