One thing that happens a lot to me is I get the occasional hater. In the early part of my career (which is where I'm at now), I have been blessed to not get very many of these types of people in my life. I have had a few and, I'm not going to lie, I considered giving up as a writer. Instead, I used it to motivate myself.
I had a classmate tear apart a script I wrote. This person's comments were so bad that I actually turned the comments in to my teacher. It wasn't that I didn't think my script was perfect (it wasn't). I felt that in an environment where we were supposed to share "constructive criticism," this student needed to word their comments to me differently. The teacher agreed. Later, the student apologized to me and we were able to reconcile The student also saw me go from a shaky beginner to a polished novice throughout the course of the class.
I have been on the other side of the equation too. I have read work that I didn't like. It happened in a class about a year ago. I was peer editing a piece and it was awful. As I read it, I remembered about the times that I had haters (particularly the incident described above) and considered that when making my comments. I was honest with the person but made sure I shared it in such a way that this person could continue to write. When our group met to share our feedback, I actually realized the writer was doing something different with the narrative structure and it made more sense to me.
I am in a fortunate position these days because I am able to receive and demand constructive feedback. When I am published (or produced depending on the medium), I am going to encounter people who aren't going to like my work or think I'm not a good writer. There are going to be people criticizing me who I have never met and likely never will. I hope that I will be in a place where I can learn from them and grow. That's why I don't mind criticism. However, I do feel there are ways to criticize without destroying someone.
I have a lot of respect for Simon Cowell. The man knows what's good and what isn't. Some of the people who would audition for American Idol were truly awful. I don't know if they were really bad and knew it or if they were bad but were constantly told how good they are by people who were afraid to let them down. Cowell was honest and I liked that. What I didn't like was when he'd say something like "Never sing again." That was a little too extreme. Giving up should be an absolute last resort. If you are truly passionate about what you do, think about what needs to be improved.
I have had people criticize my work and I've used it as an opportunity to change. If someone complains about the plot, I will see if I need to tell the story from a different angle. If someone doesn't like a character, I ask myself why the character is there in the first place and see if I need to justify their presence in the story. If the dialogue's not working, I take a look at that and see what needs to be changed.
Feedback--good and bad--helps me. It helps me to know from an outside perspective what's working and what isn't. If someone tells you to stop writing, ask yourself why. If that person is the person who sits next to you in a beginning writing class, they probably aren't the best authority because they're learning alongside you. If it's your publisher, I might take them a little more seriously. The only one who can stop you from writing is you.