Well said @Cheryllou "They act this way to make you the villain as it absolves them of guilt".
Do NOT listen to whatever bullshit your ex constructs to justify him treating you badly. It's really really not you, but they will scapegoat you to make themselves feel better for hurting you/ shagging someone else/ whatever. After all, if you are actually the mad/bad/sad person they claim you are, what could they possibly do other than bin you off and/or take up with someone else? They absolve themselves of guilt by retelling your whole relationship story with you as the one at fault. It's almost comical how transparent it is, but don't be fooled and certainly try not to spend hours going over and over whatever bullshit justifications they came up with.
It doesn't matter that it's not true, it doesn't matter if you can prove it's nonsense, they are no longer listening to you, and they are no longer your person.
You get to write your own story now. And rewriting your own history to recognise that it wasn't all amazing and, well, "fuck you Dave" is helpful.