why am I so fucking stupid?

Me and my baby daddy were together for 3 years. He cheated the entire time we were together. He even gave me an STI from sleeping around and then blamed me for it, saying I cheated. Well, we recently finally broke up. I ended it. He acted devastated and heart broken, then 3 days later, he had a new girlfriend. Then, they broke up after about a week. the entire week he igored me the entire time, when I was texting him about our kid, nothing else. She stopped talking to him, and guess what? he came running back to me. I knew it was because she stopped talking to him, but I convinced myself it was because he loved me. So we were working on things again (I know im dumb) the entire time we've been hanging out all he has wanted to do is have sex with me, nothing affectionate or anything. Then I seen texts on his phone flirting with about 4-5 people. Why do I keep giving him chance after chance? I'm so fucking stupid. this whole thing is fucking with my head. I feel like I'm never gonna be good enough for anyone. everyone says there's a prince out there for me waiting that'll make the things he did not even matter, but I don't believe it. I think im just worthless and unlovable.