You've heard the cliche lines, "It's not you, it's me" or "I don't think I'm the best for you". It's normal to feel insecure every now and then in every relationship, but if the reason for giving up on someone is because you don't think you're "good enough", the insecurity runs a lot deeper than the relationship itself.
Think about any challenge you've faced in your life. Imagine, if every time you felt you couldn't handle that challenge, you just gave up. There would be nothing in your life that you've worked for. Love and commitment is the same way. Not everything is going to work out, not everything is going to have perfect timing, but the way to make the relationship worth it is choosing the other person every day, and choosing to work hard to overcome anything. The best things in life may be free, but to make those best things last, you have to work hard.
If he told you that he "isn't good enough for you", he's not choosing you. He's not even choosing himself. He's telling you that he doesn't want to work hard to overcome any obstacles for you, including some of his own. He's accepting defeat, but that doesn't mean you have to. It isn't your job to make him feel secure with himself. It isn't your responsibility to make him feel like he is "good enough" for you. Him deciding what is best for you is his last attempt at trying to have some type of power.
I know it's hard. It's so easy to sit there and tell him that he is good enough. Tell him you love him and you'll work harder to show him that you do. That's the thing though, you shouldn't have to. Your love should be enough for him to realize that you want to be with him, you shouldn't have to prove anything. If he really loves you and wants to be with you, he'll better himself every day to be the best for you, not telling you to find someone else better. If he doesn't think he's good enough for you, then he isn't. Period.
You deserve someone that will look at you and all that you are and want to be the best version of themselves for you. You deserve someone worthy of you. You deserve to have someone choose you every day. Don't settle for anything less.