It’s okay
It’s okay to feel bad.
Just because you think you might have fucked up doesn’t mean you aren’t a good person. It’s just that, despite everything you felt, you and that person weren’t compatible. Not in the relationship type that is.
Breaking up doesn’t mean for a fact that you can’t be friends with the person, because after all you did share something, and it would be a waste of a friendship to just blow it off.
And the memories will hurt, you will blame yourself, asking yourself what you could’ve possibly done to prevent the events that occurred. But I strongly believe that your destiny is written somewhere. However it is written with a pencil, that way you can still change it if you aren’t satisfied with what will come to you. But some things can’t be changed, and if these things happened, there’s a reason, you will find something better along the way. Maybe not today, or tomorrow, or even a decade from now; but it’ll come, you just have to be patient.
In the meantime try to channel what you feel and push it into a positive source of energy. Write more, study harder, be happier. Nothing is holding you back. You have your whole life in front of you, and you’ll never be younger than you are right now, so enjoy it.