For me, for example, I started writing with composing instrumental for orchestral arrangements and writing rap songs! Yup, I know. They had nothing to do with each other! But for each of them I had my own reasons, with the logic of the 11 years old boy! My rap songs were simply because I was way too hardcore fan of hip-hop. I was looking at Eminem, Tupac and Rakim and telling myself "I want to be this guy". But then I was turning the channel, seeing Hans Zimmer and Yanni and telling myself "wait, maybe I want to be this guy instead!" And this confusion was going on for years. But based on the environment I was living in, the hip hop thing worked better, until a few years ago that I ﬁnally managed to spend more time on the orchestral music and gain that balance.
Okay, got too far from the topic. Yes, there had been countless times that I was so close to giving up. For various reasons including my publisher was really bad (which became the reason for me to become a publisher myself and open my own publishing label), countless number of collaboration projects which was ruined because the co-writers gave up half way for various reasons, etc. But one thing is that I learned something good from each and every of all these bad experiences. Which was to work with different people but never fully rely on anyone to the point that I leave the destiny of my career to them.
Bottom line, this is a rough and ruthless industry. Your beautiful dreams will crash countless time, you going to get hurt, a lot. But if you really love it, you are going to survive it and you are going to get successful eventually. Just don't give up and any time you get to the point that you ask yourself that what the hell you are doing, remind yourself of the reasons you started this from the ﬁrst step.