What do I do?

I need help. I caught my fiancé messaging his ex wife (who he has 3 kids with) from an anonymous number asking to have sex. She didn't know who it was, but after a few guesses asked if it was him. He confirmed in a round about way. I made her show me the entire conversation. I'm literally so broken I can't function. He hates her, so he makes it seem. Why would he do this? He's never cheated before. All the advice I have received is "leave him he doesn't love you he'll do it again" which I already know. But when you have so much invested in someone I feel like you owe it to yourself and the relationship to try to get through it. But the question is, how? How do I try to move forward with him? Any advice on how to handle it or make sure it doesn't happen again? I'm so desperate

Edit: he denies it 100% and says she made it all up herself. She is a very shitty person. But I believe in my heart that he did do it. He is completely distraught at the fact I'm thinking about leaving him over this. I just know I can't walk away right now