Time overlap between two postdocs? Simply keep two affiliations or quit the first position earlier?
Around here (in Nordic countries), many institutions and non-academic workplaces include terms about informing the employer of other work besides the one the contract is for. As such, I would be contractually obliged to inform the university that I am also emplyed (presumably full-time) by another institute. Since both of them would have a claim to my full time work, it would be unlikely that I could satisfy that requirement, I would expect them to not accept the situation.

In your case, I would discuss the situation with my current and future superior and give up one position at the same time as starting the other, so that I am only employed once. At least in mathematics, there is typically flexibility to adjust the starting and ending times of the contracts by a month or two, as convenient for everyone.

Also, you can just resign. Out of courtesy, as Buffy noted, please make a clean exit where you finish as much unfinished business as possible and take care that all duties you have (teaching, running a seminar, etc.) are transferred to someone else. Make sure your data or code is available and documented and your collaborators and superiors know where to find it, if this is relevant in your field and country.



At least in pure and applicable mathematics, it is expected for one to continue previous research projects at the new institute. This might be very different if you are hired for a concrete job as a part of a team, but I would guess that most academic jobs allow a measure of flexibility in the matter, as outside collaborations are usually valued. Discuss with your future supervisor if you are in doubt.