Give up on him and while your single, get some personal therapy to help you stop having these funks and black moods you get into. You can't expect anyone to be able to put up with up and down roller coaster emotions. It's not healthy for him or anyone else to try and do that with you and I don't know of one person (well maybe one but he's a nut case) that would tell this guy to stick it out with you when you aren't in a healthy place and therefore capable of maintaining a relationship free of ongoing dysfunction.
Work on yourself to help you to be the best you that you can be and then you'll be able to keep things happy withint your relationships, romantic and otherwise.
Be well.
“The willingness to accept responsibility for one’s own life is the source from which self-respect springs.” ~Joan Didion