OK ... I think you're getting somewhere with 'I'm a mess' and 'I'm an idiot'.
You are likely to be a mess - that's virtually universal for BSes. Frankly, IMO, realizing that is the first step in healing.
You are NOT an idiot. There's no single path to recovery, and we get no training in finding the path. You jumped to some conclusions; that's very human. You can forgive yourself, and I hope you do.
IMO, you jumped to D without thinking about it. I believe you made some decisions about M when you were a kid who knew nothing about life, and it's a really lousy idea to let that childhood decision govern your adult life, when as a child you knew only what you observed from your adult father.
You're an adult now, and you owe it to yourself, your kids, and even your W to make decisions as an adult with your adult knowledge.
If you're reporting your religious beliefs accurately, you still have to D. But ... I'm Jewish, and some interpretations of Jewish law say one must D if one's W commits adultery. But I checked with some pretty fundamentalist rabbis, and they counseled me to R. So I recommend checking with your religious leader to make sure you interpretation is correct, and remember: even if your religion allows both D & R, you are still free to choose D.
I think it's fair to say that all of us want our WSes to have stayed faithful, but that's not what happened. Given your W's A, though, what do you want? I think R is possible for you, if you want it.
Understand that it's OK to have to deal with mixed feelings - for many of us, it's not an easy choice, especially when one's WS is remorseful, as your W probably is. I think you may find yourself choosing D because of your beliefs, even though you think R is possible. It's fine to D under those conditions, but healing will require you to resolve your mixed feelings. Even if they're not mixed, you will have to deal with your anger, grief, fear, and shame - the normal feelings that come with being betrayed.
I know I've written about D vs R, but my hope is to help you deal with being a mess. The feelings that come with being betrayed are beyond awful. Early on, there is no obvious winning choice - you have to choose between staying with someone who hurt you or leaving someone you've loved.
If you continue to accept and deal with your feelings, however, you will find a winning choice - the knowledge that you can find joy after being betrayed, either through D or R.