I have read a lot of posts this week where women are saying they are staying or have done for the sake of the children.
Nine years ago I found out my h had had an affair, well he told me but only because someone else was about to, and I felt for reasons too personal to post, that I had to stay. Three reasons I can say were because I still loved him, I didn't want the children to be uprooted and I felt he'd been a good husband then and everyone is entitled to one mistake. All these later I feel differently so we don't need to dissect that specifically. This may sound like a contradiction but it's more a retrospective reflection and there's more to it than I can say here.
Now I'm divorcing him for something else and our children are 18-23. They are doing okay and I'm doing much much better than I ever thought I would. Less relevant is he is not doing okay at all.
Stay for yourself if you want but if you don't, don't stay for the children. It isn't fair as when they find out you stayed for them but were unhappy they will have guilt. You deserve to be happy. Not just the children.