Touma from A Certain Magical Index has terminal bad luck and a negative outlook, but will fight until the end for anyone he cares about.
In Puella Magi Madoka Magica, Akemi Homura seems to be this. She knows that whenever she resets time to prevent Madoka's death, it always results in things getting worse; Madoka either dies again or becomes an increasingly powerful witch. Kyubey even points out that all she's doing is making Madoka into a stronger witch. Yet despite everything, she never stops trying. She also knows there's no hope for Sayaka, who is fated to die in every timeline, but she still saves her life (for the moment) by retrieving her Soul Gem after it's thrown onto a truck.
In Hajime No Ippo, in the second match between Ippo and Sendou, Sendou is hit by a full Dempsey Roll by Ippo, seemingly ending the match. But he gets on his feet again. He already knows he has lost, and he still refuses to drop to the ground or go unconcious, just so he can watch the face of the man who defeated him.
Fujimaru from Snow White And Seven Dwarfs, due to being a male Broken Bird who sincerely believes that the heroes can't win—but has too much of a conscience to just let them die when he can help.
Aberforth Dumbledore in Harry Potter and the Deathly Hallows is convinced that Voldemort is going to win and advises the heroes to give up and flee the country. Naturally, he still shows up to fight when push comes to shove.
Rincewind in the later Discworld novels, in particular Last Hero.
Crowley in Good Omens. At one point, when Aziraphale has gone missing, the Apocalypse is beginning, and it looks as if there's no hope, Crowley thinks he might as well drink himself into a stupor while he waits for the world to end. Instead, he drives at top speed to Tadfield to avert the Apocalypse, holding his burning car together through sheer force of will.
Most of the main characters (especially Frodo) in the later parts of The Lord of the Rings. Several people get speechs to the effect of "We're pretty much finished at this point, but we're going to carry on because what else can we do?"
Usually he's anything but this trope, but in Luke Skywalker and the Shadows of Mindor, the titular character experiences a severe And I Must Scream, after which he is deeply shaken and nihilistic. It comes up several times that he no longer sees the point; even if his side wins the book's conflict, ultimately it won't even matter. And yet he keeps going and continues to be compassionate, because someone has to.
In Peter Pays Tribute, Peter is convinced that he will never finish the tasks his god demands of him, but he refuses to flee. this is partly out of cowardice, but partly out of a sense of duty, even if his task is impossible.
The narrator of William Ernest Henley's "Invictus."
Atticus Finch knows full well that the racist jury will never acquit Tom Robinson, a black man, even if all evidence points to his innocence. He gives his all in defending him anyway, because no one else will, and it's the right thing to do.
The Aiel of the Wheel of Time series have this trope ingrained in their culture due to prophecy about "He Who Comes with the Dawn," a Destructive Savior foretold to unite and lead the Aiel people, but also destroy them.
In Those That Wake, Mike is this. He thinks the world sucks, he's worthless, and he probably can't do anything to change it, but he'll fight anyway.
Hero of Ages: Elend gives a speech to his men, asking them to fight even though they will die if they do. He says that every second they're able to keep going is a second longer the people they're protecting will stay alive. Of course, it turns out that they only survive as long as they do because they're all burning atium. And because Atium is actually Ruin's body, their deaths mean that Ruin can't get his full power, making it possible for the Hero of Ages to win.
In 16 Blocks Jack Mosely fully expects to be killed along the way but he is determined to get the witness to the courthouse to testify. Even if he succeeds the witness's testimony will incriminate Jack as a Dirty Cop and send him to jail. His only real chance to walk away from the whole mess is to let the witness be killed but that is the one thing Jack is determined will not happen.
Rocky has the title character realizing that he will fail the fight against Apollo, but decides that he will go the distance so he would not be seen as a bum. Also helps that he's just a flat out Determinator.
Angel: Though there is the occasional reprieve, at heart, Angel suspects that he will never stop paying for his crimes. He and Spike share a grumpy exchange about how they're both going to Hell, and thus will never be rid of each other.
Ryotaro Nogami, the protagonist of Kamen Rider Den-O, willingly admits that he's not very strong or smart, and that he has insanely bad luck. That doesn't stop him from doing his job and protecting the timestream, which results in his eventually Taking A Level In Badass.
In Lexx, a number of the Brunnen-G decide to stand and fight against His Divine Shadow, fully aware that they have no chance of success. An in-show musical touches on this a bit more, and even inspires the protagonists to take on a similar attitude.
It matters not if the cause is lost and we cannot stop the tide. We will fight to the end, and then fight again. It will be a good way to die.
Al: So you think I'm a loser? Just because I have a stinking job that I hate, a family that doesn't respect me? A whole city that curses the day I was born? Well that may mean loser to you, but let me tell you somethin'. Every morning when I wake up, I know it's not going to get any better until I go back to sleep again. So I get up, have my watered-down Tang and still-frozen Pop-Tart, get in my car with no upholstery, no gas, and six more payments to fight traffic just for the privilege of putting cheap shoes on the cloven hooves of people like you. I'll never play football like I thought I would. I'll never know the touch of a beautiful woman. And I'll never again know the joy of driving without a bag on my head! But I'm not a loser. Because despite it all, me and every other guy who will never be what he wanted to be are still out there, being what we don't want to be 40 hours a week for life. And the fact that I haven't put a gun in my mouth, you pudding of a woman, makes me a winner!
Speaking of humans. Beset on all sides by xenos and galactic horrors while also being attacked from within by traitors and heretics, their God Emperor is tied to a millennia-old life support machine that is in serious need of a good fix, all the technology and grandeur of the by-gone golden age is slowly being forgotten to be replaced by superstition, Fantastic Racism and blind zeal, the Imperium of Man loses worlds everyday despite it's overwhelming might. Yet we Puny Earthlings don't cry or despair, we stoically take these losses and try to hold the line as best we can, or failing that, drag our enemies down with us. For the Emperor!
Max Payne goes through the entire first game knowing perfectly well that there are only two outcomes for him: either being killed during his Roaring Rampage of Revenge or being put away for life upon completing it. In fact, after he goes free thanks to The Man pulling a few strings, he considers himself to be a Karma Houdini.
Javik in Mass Effect 3 believes that Shepard's cycle is doomed for failure. However giving up is not an option for him, especially after his race and civilization sacrificed themselves just to get him to this point.
Also Commander Shepard, by the end of the series. Case in point is his/her reaction when the Reapers first invade and s/he's asked how to stop them.
In Hakuōki, Hijikata is fully aware that the balance of power is shifting away from the shogunate and that the Shinsengumi are on the losing end of things, even before the Boshin War has officially kicked off. Nevertheless, he gives it every possible effort, sticking with the fighting from Kyoto all the way to Hokkaido and the war's bitter end even when all of his comrades have died or gone their separate ways.