Self doubt is a powerful thing, and has it's purpose. However, it can be really detrimental to every day life. In this case, It sounds like you have been through a lot and self doubt is warranted.
Emotional trauma can happen in many ways. And break ups can even devastate the best of us. When we end a relationship, especially ones that have gone on for a long time, we say goodbye to a big part of our lives. Often times in a relationship your partner becomes your best friend, somebody who you can lookt to for support at all times, and can also share your life with to the full extent. And it can be hard to go back to not having someone to do that with anymore. It sounds like you got really close to your partner and invested part of yourself in him. This is common of co-dependancy.
The co-dependant often puts their happiness and security into another human being; whether you are happy is dependant on whether they are happy, or if they give you the behaviour you want. Relationships structured like this can be an emotional rollercoaster, and can seem blissfull from the inside while from the outside looking in are quite fundementally insane. Relationships like this are very common, and almost always don't last more than a year. I would estimate that about 90% or more of relationships that feature a co-dependant partner will experience a seperation of the partners within it's first year. So this is common.
Anyways, how does this relate to you? It sounds like you relied on your ex partner to feel secure, to feel happy. And now that that's gone, you arent sure what to do to feel okay again. However, I want to remind you of something. What people are attracted to in a person (usually) is the fact that they are a whole human being in of themselves. That they know who they are to the world, that they know themselves, and that they aren't afraid or discouraged to be that person. Everybody has the potential for this, and it is very achievable. This is a very attractive quality for modern day society, too. I urge you to recognize how whole and wonderful of a human being you are, how you have got so much in your life that works for your advancement as you grow on.
And please seek help! Find somebody who you can trust and confide in, seek support from those around you. Open up. Don't bottle this in.
What's happening to you is that you are experiencing depression and loneliness. It's a lot more common than you might think. Reach out to those around you, nobody deserves to feel this way. And they might understand it all too well. Sympathy can be a powerful mental healer.