You haven't failed. Really. I know it doesn't feel that way just now, but think about it....
Relationships change over time. That's no-one's fault. Really it isn't. Your ex did a horrible, cowardly, cruel thing, but you know what, at least you know where you stand, you are not in the dark anymore. You can look reality in the face and say, right, that wasn't working, this man didn't cherish me as I deserve, and now I can start creating something that DOES work. That belongs to me, that no-one can take away from me and my DC.
Think of it this way... many people who "stay together" are fucking miserable, or are being deceived, or are completely vulnerable and dependent on the goodwill of a partner who could, at any time, change their mind. You are not going to be one of those people. You get to choose how things are going to go in your life from now on. Yes it was nice to rely on someone... and now you are going to spread your wings and be a woman in your own right.
I remember how all-over-the-place I was at 8 weeks pp. Of course you feel you've no confidence... you're very vulnerable right now. That's natural. And it will change in time.
Start making plans to study. Even just a single module of something. A creative writing course, or something sciencey that interests you, or a bridging course. Start small.
But most of all just take very good care of yourself. There's nothing wrong with having a cry, eating cake, and so on. Lean on your friends. Watch stupid telly. Talk on MN. This terrible time will pass. You've just got to hang on a little longer.