Don't offer to do anything for the company you're resigning from. It will backfire into a problem for you in no time.

 
If you are leaving, then why offer to stick around to train the employee who is going to take over your job? I get the fact that you want to end things on good terms. But it's just having to do more than you should for a company you will be leaving in no time. You wanted to leave for a reason. Why stay? Why help out? They do not deserve it, and there is no reason for you to stay there longer for a favor. 


And when the situation escalates even more, like in the story below. Not only is this former employee helping out in something that he has no reason to help with, but he is also having to put up with an annoying trainee that doesn't respect him or listen to him. If I were in his shoes, I most definitely would have gone to my former manager and explained the situation. Say how awful they are behaving and how badly they are at the job, how they don't see me as an authority capable of teaching, so they do not care for my knowledge. And with that, I would leave the company and move on with my life as I should have the moment I resigned. But well, that's just me. Let's hope this employee follows in my footsteps.