As long as you're still getting paid, you're obligated to do whatever your employer tells you to do during your official work hours (if it's within the context of your job and legal).
Refusing to do so would, at best, burn bridges and, at worst, result in them instantly terminating your contract and no longer paying you or potentially get you into legal trouble.
If they're no longer paying you, you're not obligated to do anything. You're also not obligated to work overtime (paid or not).
If you're asked to work overtime or do unpaid work, it would be reasonable to decline or (if it's a non-trivial amount of hours) request additional payment. Although this is not to say they would think it's reasonable.
Your contract may, of course, create different obligations, and you should adhere to those instead of what's written here. Any relevant notice periods should also be specified there, in some other legal document or in some regional employment law.
If you want to leave a good impression and avoid burning bridges, it would be advisable to try to pass on knowledge (through teaching or documentation) even if you're not specifically asked to do so. You might even want to (gently) push back on other tasks and emphasise the importance of passing on your knowledge. Although some won't be able to see the importance of transferring what you know.