Via Nathan Bransford, a very thoughtful piece by author Natalie Whipple on the struggle to stay hopeful when your writing dreams don't seem to be coming true.
I would add that I think it's perfectly fine to feel like crap about your writing once in awhile. Even more than once in awhile. After all, we writers generally get a lot more bad news about our work than good news--and more often than that, we get no news. I am not a big fan of accelerated cheering up. If you need to sulk, sulk. Just be aware that's what you're doing, and be open to the good things, even little good things, that can crop up while you're in the midst of sulking. Maybe a solution to a plot problem that comes to you while you're muttering "fuck" to yourself in the car.
In short, here's another way to think about not giving up: you can still write when you feel like crap about writing. You still go to your job when you feel like crap about it, don't you? So you can write.