My heart broke reading your post. It really did and partly because I am in the same boat. My whole life's dream has been to be married (to my soul mate) and have children. I thought that was what I was doing too. Again, same situation 2x4 upside my head and now I am dealing with a WAW who claims to have been so desperately unhappy for years and is having an affair. I still don't know what happened but have to deal with the nightmare.
It's a terribly bitter pill, and yes, I have thought it would be easier, way easier to just check out. There would at least be an end to the pain and rejection, right? The truth is we have to own this terrible time in our life, and go through the pain. Why? Because we have kids who need us. We have screwed up partners who have made really bad choices which make us all suffer but still we have to be there for our kids.
I really do believe that God has a plan for each of us and even if we can't see it now, we have to keep the faith and believe that are best days are ahead of us, not behind us.
You are not a failure, just one part of your life is not working out as you planned, try to focus on other parts that are working. I am sure you are a great Dad and you want that to continue. Make your half of your daughters time the best part of her life!
Hold on and I will be virtually holding your hand.