I have a collection of tools to keep me going:
along the lines of Jens, I often say 'Shut up, brain' when it starts telling me to stop.
I study Buddhism and one of the teachings that has stuck in my head is that all things are temporary, and that pain (suffering) is attachment to the idea of wanting things to be other than they are, so I often chant to myself:
'This pain is temporary, this pain is just my ego. I can choose to keep going.'
One of my favorite albums to pump myself up is 'Treats' by Sleigh Bells. They sound like hard core, rockin' cheerleaders with sick crunchy guitars and electro baselines, so I love using the album to pump me up before races. The song 'kids' has a line that I often draw on my forearm to look at when I start wanting to quit or slow down:
'Did you do your best today?'
Its enough to make me think about whether I really do need that break or to drop pace, or if I'm really just wanting to slide back into a comfort zone. Most of the time, its the latter.
Along those lines is a Zen affirmation my meditation teacher has us say at the end of a session. Its a little more intense, but it kicks me in the butt to remember that my time in this body is limited and the time that I will be able to do the things I do (endurance racing) is finite and not to waste the opportunities I was given to race, to improve...etc.:
"Let me respectfully remind you, life and death are of supreme importance. Time swiftly passes by, and opportunity is lost. Each of us should strive to awaken, awaken, take heed....Do not squander your life."
My strength trainer often helps me lift the last few reps of a heavy set and if I look defeated, he yells at me to 'keep going, I'm here! I WILL NOT LET YOU FAIL!!' this also works quite well to chant to myself when climbing hills on the bike.
And if all else fails, I fall back on these two:
"Quitters don't get bacon" (used during a morning race or long training run when I have brunch scheduled afterwards)
"Quitters don't get margaritas" (can be used at will. Also works when I find myself getting lazy about taking public transport and wanting to hail a cab).
PS - great radiolab about the limits of human endurance here.
http://www.radiolab.org/2010/apr/05/
they discuss ironman athletes and racers in RAAM (the slovenian who was killed on a training ride a few weeks ago was featured. sad to think about, but listen to his interview, its pretty wild!).