Harry... you must realize that if you choose this man as your teacher and your friend, your first mentor, then one way or another you will lose him, and the manner in which you lose him may or may not allow you to ever get him back.
One of the best-known examples, Roy Focker in Super Dimension Fortress Macross —Hikaru's "sempai" and leader of the elite Skull Squadron aboard the titular ship.
And in one of the sequels, MacrossFrontier, Focker's death is directly referenced when the current Skull Squadron leader, Ozma Lee, all but telegraphs his death all throughout the episode, going as far as the "pineapple salad" (in this case, pineapple cake) that spelled doomed for his predecessor, as well as similar shots and camera angles. He was rushed to the hospital and survived, and the other characters acknowledge how dramatic it would have been if he had died (almost verging on Breaking the Fourth Wall.) Then this trope hits the other mentorinstead...
With the danger of spoiling just by mentioning the name of the series: Hikaru no Go. Sai does find peace. The series climax is Hikaru learning to move on.
Rurouni Kenshin has the The Ace mentor Hiko Seijuro, master of the sword school Hiten Mitsurugi, who was first abandoned by his student Kenshin Himura. About over a decade after, Kenshin returns to him to learn the ultimate technique of the sword school they both use, which could only be learned by killing the master. Subverted when Kenshin does learn the technique but did not kill his master thanks to his reverse blade sword.
Naruto. So. Damn.. Much. The idea of people working for the best of the next generation is a major theme, so it suffices to say that teachers have a tendency to die protecting their students or their village. To wit: The Fourth Hokage, The Third Hokage, Asuma, Jiraiya. Even the ones that survive tend to almost die quite a lot.
Subverted with Kakashi for he was revived and Tsunade for she went into a coma and woke up from it.
Trickster Mentor Cross Marian in D.Gray-Man disappeared from the Black Order headquarters while he was under house arrest. Given the amount of blood and the fact that his gun and mask were found on the floor and there were signs of a struggle, he's currently presumed dead, but they Never Found the Body...
Koumyou Sanzo from Saiyuki possibly intentionally allows himself to become a victim of this. He sacrificed himself to save Genjyo Sanzo (then Kouryuu) from youkai bandits intent on stealing the sutras... but as Ukoku later points out he should have been more than powerful enough to send those bandits packing without making a heroic sacrifice. This implies he knew exactly what he was doing when he allowed himself to be killed. This is supported by the fact that in his formative years he hung out with a youkai who can see the future and the fact that he'd only appointed Kouryuu his successor a few minutes before the attack, suggesting that he had detailed knowledge of what would happen and when.
In Dragon Ball Z we see Future Gohan become a mentor to Trunks, it soon becomes a father/son relationship. He is the only one who understands Trunks as a fellow half Saiyan. At the end of the movie, he dies, leading to Trunks having a Heroic BSOD in which he becomes Super Saiyan - the very thing Gohan was trying to teach him.
Earlier on in the series, Master Roshi acts as this; having taken Goku and Krillin (and later, Yamcha) into his home and training them in his own, err, odd, martial art. When Piccolo shows up, Goku is presumed to be dead and Krillin actually IS dead, and Tenshinhan is the last hope for the future, Roshi uses the suicidal Evil Containment Wave to reseal Piccolo. It doesn't work, and, this being Dragon Ball... he gets better.
This happened to King Kai when Goku, performing a Heroic Sacrifice to save Earth, teleported the about-to-explode Cell to King Kai's planet/house. King Kai wasn't terribly bothered by the sudden transition, since he lives in the afterlife anyway, but was supremely annoyed Goku blew up his planet.
Gundam Age has General Woolf, a mentor of the first and second protagonists, as well as his Expy, Seric Abis in generation 3.
Hunter × Hunter has Kaito, the Hunter who inspired Gon to be a Hunter in the first place.
Agent 355 in Y: The Last Man is both recruited into the Culper Ring and trained by the previous Agent 355. One of the techniques she passes on is that the jaw is the most powerful muscle, so when the ex-mentor goes insane and tries to assassinate the President of the United States her successor bites her neck open.
Averted in X-Men by Professor Xavier, who died once but got better (it was never him). And like any mentor, he set a precedent that his students followed time and time again.
However because he's too smart and helpful, most plots especially adaptations will take him out of the story through coma or kidnapping or something until the problem is resolved. He's just not killed by them.
As of Avengers vs. X-Men, Professor X is dead again. We'll see how long that sticks...
Subverted by Emma Frost, who outlives most of her students.
Stick, Daredevil's teacher, who dies protecting him, Elektra and his other pupils (The Chaste) from The Hand. Averted with Master Izo, who outlived all of his pupils. Although, Daredevil: Ninja seems to indicate that Stick got better...
Doctor Strange's mentor, the Ancient One, dies and becomes one with all reality. A subversion, since 1) he deliberately trained Strange as his successor, 2) he asked Strange to kill him, and 3) he's not "gone" in any strong sense.
Professor Trevor Bruttenholm is killed at the very first Hell Boy story.
In The Prayer Warriors, after Percy Jackson converts his mentor Chiron to Christianity, Chiron goes off to convert the rest of Camp Half-Blood. Shortly thereafter, one of his students comes back and says that Chiron was killed and eaten by the people there. Death Is Cheap in this fic, but Chiron never comes back.
Lt. Dan of Forrest Gump tries to be this to a T. He gives Forrest and Bubba advice on how to survive 'Nam concluding the mentor part and then tries to die fighting in the war believing that it was his destiny. However he didn't count on Forrest to subvert that.
Obi-Wan's own mentor Qui-Gon Jinn suffered a similar fate.
Obi-Wan was meant to live in the early versions of the Star Wars script, but George Lucas was frustrated in that during the big battle against the death star, he would have had nothing to do. He eventually decided to kill him off before the third act.
Yoda dies too, although of old age.
Mickey, Rocky's mentor, dies in Rocky III after Clubber Lang shoves him, setting off his bum ticker and triggering a heart attack.
Magi Lune in FernGully seems to exist entirely for this purpose. She appears in a handful of scenes only to later die at the end of the film to pass on her powers to Krysta.
Subverted in Reservoir Dogs: Experienced criminal Mr. White takes a bullet for his young protege, Mr. Orange, survives, then kills said protege after he confesses that he was the rat all along. And only then is he shot dead by the police.
Played straight in Kung Fu Panda with Master Oogway, though at least that's a natural old-age death, and then subverted with Master Shifu at the end.
In Iron Eagle, mentor figure and Retired Badass Chappy Sinclair goes down early on in the assault on the enemy nation that captured The Hero's father, forcing Doug to fight the rest of the battle alone. Subverted in the end when it turns out Chappy bailed out and was rescued.
Averted in The Matrix: Morpheus survives all three movies. In fact, he's the only one of the three main characters to do so.
In Road House, Dalton's mentor Wade Garrett is killed off-screen by the Big Bad's men. Dalton finds him with a knife in his chest, despite Wade supposedly being better at everything than Dalton.
Subverted in Epic. Ronin only looked done for; it turned out he was much too badass to just go out surrounded by hundreds of Boggans.
Star Trek: Into Darkness: Christopher Pike spent all of the previous film whipping a young Jim Kirk into shape, and the early parts of Into Darkness trying to continue that work, only to get caught in a mass-assassination attack by John Harrison. Jim's subsequent rage and sadness over Pike's death drives much of his actions for the rest for the film.
The Secret of KellsAverted with Brendan's mentor, Brother Aidan. Having escaped the Viking raid on Iona he is also one of the only survivors of the attack on Kells. He is soon after saved from the Viking squad who attacks him and Brendan in the forest. He is then shown to spend his remaining years travelling with Brendan, continuing to mentor him and living to see the completion of his life's work, the Book of Iona/Kells. He however does not live to the conclusion of the film, eventually dying of old age.
Jesus Christ from The Bible is possibly the ultimate example of this trope.
In a manner of speaking, John the Baptist also qualifies, as Jesus' "older" cousin and the guy who baptized him. He also qualifies in that he explicitly states he's not here to overshadow The Hero.
Mathin in Robin McKinley's The Blue Sword, one of the elite King's Riders, is assigned to tutor Harry Crewe in the ways of riding and combat. He lives, though, with an awesome scar from Harry's magical healing powers.
The penultimate example would have to be the despised Severus Snape. Before you rush to disagree, recall that he gave excellent advice while foiling Harry's attacks at the end of book 6.
He also gave a very accurate explanation on the process of occlumency, although Harry was not inclined to take it to heart.
Indeed, McGonagall and Arthur and Molly Weasley are Harry's only parental figures that don't fall victim to this trope, and even Arthur comes pretty close in book 5. The author even considered killing Arthur at various points but kept changing her mind.
Dumbledore in particular clearly had to die, because he was the one person explicitly more powerful than Voldemort; the only person in all his life that Voldemort ever feared. If he weren't killed before Harry and Voldemort's final duel, the prophecy that Harry has to be the one to kill him would make no sense.
Depending on your point of view, this is either played straight or subverted with Gandalf in J. R. R. Tolkien's The Lord of the Rings. The wise old wizard, who acts as a mentor to Frodo and later to the whole Fellowship through the first part of the novel, dies in Book II of six. He does come back Back from the Dead again in The Two Towers, but Frodo has already gone his own way by then and can no longer be mentored by Gandalf; while Gandalf himself, with his increased power, becomes a leader rather than a mentor after his return.
Methuselah and Abbot Mortimer are both mentor figures to Matthias in the first Redwall book, and both of them die.
Applies to Beleg in Tolkien's The Children of Húrin as well, though he's more of a big brother figure. He is unintentionally killed by his fosterling Túrin.
That guy, what's-his-name, Obi-Wan Iroh Julio Scoundrel... Brom! That's it! Brom in Eragon.
Afterward, Eragon has Oromis as his new mentor, who decided to join the battlefield right after finished training Eragon...just to justify this trope.
Fraa Orolo had the misfortune of being revered by the hero and being smarter than the rest of the cast of Anathem combined. So, of course he gets exiled from the not-so-hidden elf village. After a good quarter of the book spent searching for him, they reunite briefly, then he gets promptly roasted by a volcano.
Tad Williams' Otherland both uses and subverts the trope. Played straight: Renie's mentor Susan van Bleeck is beaten to death by the Grail Brotherhood's thugs; the old hacker Singh, who helps the heroes break through Otherland's security, is killed by the operating system. Subverted: Mysterious Informant Sellars continually attempts to aid the team after losing contact with them, but manages to stay alive until the climax, after which he surrenders his physical body for a virtual one.
Bluestar from Warrior Cats. Of course, like Dumbledore, she returned after her death to offer more guidance, and has continued to do so for the last three series.
Not to mention Lionheart, Yellowfang, to an extent Spottedleaf, Cinderpelt, and Whitestorm. Mentor figures in the series in general can probably be expected to die (then again, given the series in question...), but it still usually manages to be quite the Tear Jerker every time.
In Codex Alera the spirit of Alera itself is suffering this. She was brought into existence by a mosaic taken from all corners of the country, which was broken. Without it she's dying, although in the last pages she implies that she'll survive in some form. Also, she doesn't actually die until maybe the very end of the book. Even then she might just have grown to weak to appear again.
Honor Harrington's mentor from her academy days, Admiral Courvosier, is killed in The Honor of the Queen.
And another mentor, Captain Bachfisch from her middie cruise, nearly gets killed in War of Honor, but manages to survive with just having his legs blown off.
Syrio Forel, Arya's "dancing teacher" in A Song of Ice and Fire. In order to buy her time to run away, he stops to fight five guards and a knight with a training sword. He successfully kills or disables the guards, but has no chance against the fully armored knight.
Both played straight and averted in The Hunger Games, with Cinna killed for one piece of rebellious dressmaking too far, but Haymitch managing to survive all three books, and even finding a new family to replace the one he lost, and working on his drinking habit.
Spare a thought for poor Abbe Faria in The Count of Monte Cristo. He spends years tutoring his fellow prisoner Edmond Dantes. He then spends years with Dantes planning an escape from prison. Then, just as their escape plan is coming to fruition, he dies. But not before telling Dantes how to find some long lost treasure.
Subverted in The Wild Shore by Kim Stanley Robinson. Tom gets a cough but doesn't die.
Live Action TV
Kosh from Babylon 5, who knew it was coming and was trying to delay it.
Missing Mentor version in Buffy the Vampire Slayer. Wise librarian and all-round Badass Bookworm Giles takes himself out of the series to give his protege Buffy more freedom. He returns eventually and survives to the end, alive and well...though in the season 6 finale it was touch and go for a while.
Giles is the weekly series version of this trope — he can't very well die at the end of an episode so Buffy can fight the bad guy alone, then come back next week. So they did the next best thing: knock him out repeatedly.
They did kill him off at the end of Season 8 (the B.t.V.S. Comic continuation), however. Even then, though, it was more the emphasise that Anyone Can Die.
Narumi Soukichi from Kamen Rider Double - doesn't really count as a spoiler since it occurs in the first episode.
Subverted in Kamen Rider OOO where, after witnessing his mentor Date die in front of him, Shintaro Goto is spurred on to become Kamen Rider Birth for the first time; but then it turns out Date isn't really dead and was just unconscious. He survives. According to Word of God, Date was originally intended to have been killed in the scene, thus the trope would have been played straight.
Zordon from Power Rangers: Kidnapped almost immediately after quitting the Mentor job, and his first act after rescue was to give one last mentor-y bit of advice and beg for an I Cannot Self-TerminateHeroic Sacrifice. A unique case of the mentor's death actually solving all the heros' problems.
Relic Hunter Sydney's old teacher who first gave her an interest in relics was murdered to obtain one. Twenty years later. Sydney caught up with the killer.
Professor Maximillian Arturo takes the bullet for Quinn close to the end of Season 3 of Sliders. His body is left to be burned along with this Earth, which is being scoured by pulsars.
Notably averted on Stargate SG-1, where The Obi-Wan figure Master Bra'tac is noted for having survived through all 10 seasons of the show, despite multiple attacks by The Plot Reaper and even a feeling of depression in one early episode. He's just that badass.
I am not yet ready to give up. I feel alive Teal'c, like a young man... of eighty. We still have false gods to slay
Interesting version in the Veritasmanhwa. The main character's mentor, Lightning Tiger, is killed right at the beginning of the story (and his pupil receives his skeletal arm in a box as a very creepy Tragic Keepsake). However, LT wasn't old, and he'd only been training the kid for about 2 months. A character attempts to justify it later by saying the he didn't die because he was a mentor; he took on an apprentice because he knew he was going to die.
...Maybe. His heart merged with Terra's after Xehanort struck the final blow, so he might have a chance even if he's not part of the montage of "people Sora has to rescue". As Nomura pointed out, nobody in the series (except Mufasa, and maybe the Riku Replica) has actually died in the literal sense of the word.
The player character's mentor Gorion dies in the first chapter in Baldur's Gate in a battle against the Big Bad. As he's also your foster father, this is also a case of Doomed Home Town.
In Metal Gear Solid, mentor figure Master Miller turns out to have been dead all along, having been killed a few days before the game begins, and impersonated from that point on by the Big Bad.
Done in record time in Red Faction: Guerrilla - you arrive on Mars and meet up with your brother, who takes you on your first 'mission', recruits you into Red Faction and is shot by the EDF, all in the opening 10 minutes.
Done with the Professor in Cave Story, to the point that if you see him drop several stories and don't try to help him, he stays alive.
In Etrian Odyssey II: Heroes of Lagaard, players meet Flausgul and Kurogane early on and learn several important things about the Labyrinth from them. Once the player learns of their tragic history, alarm bells should be going off... the Player Punch comes upon finding an injured Kurogane and learning of Flausgul's fate. Kurogane hangs on just long enough for the player to take revenge.
Duncan in Dragon Age: Origins dies in the field of battle due to the signal made by the player character and Alistair for reinforcements not being answered by Loghain.
But it's also subverted for Mage Wardens, for whom Wynne fills the role. She's already technically dead, though. The tower also has Wizard Classic First Enchanter Irving, whose fate is entirely up to the player.
Similarly to Duncan, Nihlus Kryik of Mass Effect 1 intended to accompany Shepard on a number of missions, most likely to train him/her as a Spectre, but he is killed at the end of the first mission by the primary antagonist actually Dragon, Saren.
David Anderson is forced to stop being your mentor for political reasons and survives the first two games, only to become the intro-level squadmate in Mass Effect 3. Things aren't looking well for ol' Dave's future, especially when one also considers the high mortality rate of intro-level companions in other Bioware games. In fact, he will die in every ending. However, he at least makes it to the grand finale, impressive for a mentor.
Paladin Magnus in Ground Control, performing a You Shall Not Pass in an Order mission where you have to hold off against an endless wave of enemies. Somehow, self-destructing an Order APC creates a huge crater and destroys the supposed endless waves of enemies.
Prophecies had Prince Rurik, who took on young Ascalonian heroes as members of his personal cadre of warriors and led them on many adventures. He was killed leading his people to safety and was later raised from the dead by the Big Bad.
Factions had Master Togo, head of the Monastery where young Canthan heroes trained and their leader in the war against Shiro. He was killed by Shiro in the penultimate mission.
Bonus points: Several of the Afflicted bosses are actually mutated teachers and quest-givers from your past.
Nightfall had Kormir, leader of the Sunspears and the war against Abaddon. She sacrificed herself absorbing the god's power, and now exists as a god herself.
Eye of the North had Gadd, vitriolic genius and Vekk's mentor/father. Killed while trying to prepare a more powerful golem to assist you in combat.
In Guild Wars 2, no matter what order you've joined, your mentor from that order will die in a Heroic Sacrifice at the Battle of Claw Island.
Giro from Mega Man ZX. Since he gets his hands on Biometal Model Z, it's easily predictable he has to bite it so that you can get to use that model yourself.
Zero in Megaman X. He's watched over X from the beginning of the game, forcing Vile to retreat after X couldn't touch him. Obviously, he's the badass of the story, but he's not the title character, so he performs his Heroic Sacrifice, leaving X to face Sigma alone, with no chance at a last second rescue. Incidentally, the placement of the Vile fight in the remake justifies the over the top dialogue X uses when he faces Sigma, as it happened at the end of the previous stage, and not at the start of the fortress, making X's fury still fresh. And even though Zero gets better, he's been surpassed by X by the time he returns, and they work as a team from X3 to X8.
Lagoon has this happen to Mathias after he fails to stop Zerah from reaching Lagoon Castle. He does get to reveal the nature of Nasir and Thor's past before he goes.
In Homestuck, this has now happened to the Guardians of the Kids. Bro, Mom and Dad were all killed by Jack Noir, Grandpa was Dead to Begin With, and Bec has effectively ceased to exist due to his prototyping.
More like a mentor death contract, considering how sburb/sgrub works. Post-Scratch, the B1!kids switch roles with their guardians. Jade is assassinated by the Condesce and Rose and Dave die in battle against her. John is killed by the impact of the meteor carrying baby Jane.
In The Order of the Stick, Julio Scoundrel hangs a lampshade on this trope in this comic, saying that he intends to never see Elan again specifically to avoid it.
Done via flashback in ReBoot. To flesh out Bob's backstory we see his cadet days interacting with full guardian Dixon, who gets killed by Killabyte. Since she was shown using Glitch in the flashback, this was easy to see coming.