"I am your enemy, the first one you've ever had who was smarter than you. There is no teacher but the enemy. No one but the enemy will ever tell you what the enemy is going to do. No one but the enemy will ever teach you how to destroy and conquer. Only the enemy shows you where you are weak. Only the enemy tells you when he is strong. And the rules of the game are what you can do to him and what you can stop him from doing to you. I am your enemy from now on. From now on, I am your teacher."
InuYasha: Once Sesshoumaru had undergone enough Character Development to learn he was meant to pass on Meidou Zangetsuha to Inuyasha, he made the decision to put Inuyasha into a Die or Fly test to prove Inuyasha's worth as Tessaiga's master once and for all. All he told Inuyasha was that he'd give up both Tessaiga and Tenseiga after the fight, regardless of whether Inuyasha won or lost, but that he'd kill Inuyasha if Inuyasha lost. Inuyasha didn't even realise he'd won (or what he'd won) until Sesshoumaru discarded Tenseiga and passed on Meidou Zangetsuha which forced Inuyasha to master Meidou Zangetsuha as fast as possible to save both their lives from Hell itself.
It's speculated that the crux of Gendo's plan in Neon Genesis Evangelion was to get Shinji to hate him in order to synchronize with Unit 01. Of course, this is heavily debated, given that much is left ambiguous by the Mind Screw. A much straighter example is in Rebuild of Evangelion.
Some fans of Ranma ½ might argue that Genma Saotome is one of these who hasn't gotten around to the "big reveal yet", claiming that his various "mistakes" (which include getting his son a Gender BenderCurse while under a Seppuku contract binding him to be a paragon of manliness and trapping him as part of a Love Dodecahedron) are actually very (very) tough love training exercises intended to teach Ranma more cerebral skills. Many more fans, however, would claim that Genma is just a short-sighted, impatient, impulsive, greedy nitwit of a Sink-or-Swim Mentor who just so happens to have a student that's learned to thrive on Training from Hell and is a born prodigy at Martial Arts and Crafts.
Itachi Uchiha is/was apparently one for Sasuke Uchiha and Naruto Uzumaki himself in Naruto. He made Sasuke hate him so much that he would spend his entire life training to get strong enough to kill him, and upon his death transferred his strongest techniques to him to protect him from Madara. His methods were a little harsher than most of the examples on this page, but he got the job done...
Things didn't go quite as planned with Naruto either. Turns out Itachi had entrusted him with an emergency genjutsu that would stop Sasuke in the event he attacked Konoha. It ended up being inadvertently used instead to free a revived Itachi from Kabuto's control. At least Itachi came clean about his intentions after that, though.
The 'Lost Episode' of Love Hina reveals that Mokoto's older sister uses this: Initially, she appears to be downright antagonistic and unreasonable, but towards the end it's revealed that she's really just doing it to force Mokoto to grow stronger.
This is a near dead-accurate description of Tsuruko's introduction in the manga, although she did have a right to be irritated with the kid.
In Soul Eater Dr. Stein is originally posed as a villain who resurrected their teacher, Sid, for experimentation. By the end its all made clear that the plot is part of a remedial lesson.
YuYu Hakusho: Hiei, a Noble Demon who tries to keep his true loyalties ambiguous, has a tendency to greet Yusuke by randomly attacking him - to test how strong Yusuke has become. Since Hiei was originally recruited into Team Urameshi through a forced Defeat Means Friendship, the first few times he does this Yusuke can't quite be sure he isn't actually trying to kill him.
A less benevolent example is Toguro, who has an obsession with making Yusuke stronger in their fights because he wants an opponent against whom he can use 100% of his power. He goes so far as to make Yusuke believe he has killed Yusuke's best friend so that Yusuke's grief and rage will make him fight harder.
Genkai set up three Territory Masters to seemingly attack his friends, in the hope that they'd learn how to deal with Sensui's Seven.
In Cardcaptor Sakura it's a bit more complex because of Sakura's reaction. The basic trope is there: Eriol is a good guy and a mentor figure, but he creates trouble so Sakura will put her own magic on the Clow Cards (the Cards would die otherwise). On the other hand, Sakura has no idea that he is the one behind this, and treats him as just another of her friends.
It's possible that Bartholomew Kuma in One Piece may be this and not as Lawful Neutral as he lead you to believe. It wasn't so much that he spared the Straw Hats, but his next encounter with them, which wasn't too long after their first battle with them, he teleported all of them to different islands where they could learn and/or improve their skills.
Confirmed in chapter 591.
Ovan from .hack Conglomerate is a Stealth Mentor of sorts to Haseo. All his actions in the story are directed at making Haseo stronger than himself so that Haseo can kill him. No Ovan isn't really The Atoner but his death would really set many things right. And he knows it. Too bad he is virtually unkillable... and that's where Haseo joins the game (pun unintended).
Just a side note, Ovan was a straight up mentor for Haseo before their mutual (and very close) friend, Shino, fell into a coma.
Bleach: As an introduction to the Bount arc, three modsouls torment the main cast. They were constructed by Urahara to prepare the team for the appearance of the Bount.
Gin Ichimaru, too, though he wasn't intentionally trying to teach Ichigo. He only viewed Ichigo as his "successor" to defeat Aizen when he's about to die, way after he gave Ichigo that TheReasonYouSuckSpeech. Still, the speech helped Ichigo identify his shortcomings.
G Gundam: Master Asia is a very fitting example, Scharz Bruder probably qualifies as well, though he is hardly an antagonist most of the time.
In the 2003 Astro Boy anime, Mad Scientist Dr. Tenma creates a series of ever-stronger robots to push his estranged "son" to his physical and ethical limits, in order to make Astro into a worthy ruler for robot-kind.
Scavenger takes this role in Transformers Armada: while undercover among the Decepticons, he puts on a big show of taunting Hot Shot for the latter's lack of skill. This turns out to be a way to sneak him some combat tips.
Amnael/Professor Daitokuji acts this way to Judai in Yu-Gi-Oh! GX, dueling him to test his skill and make sure he's ready for the final battle against Kagemaru. In the dub, Yubel also acts this way to Jaden (in her/his/its own twisted way), believing Jaden tormented Yubel to make her/him/it stronger and doing the same to him. Compared to Amnael, Yubel's mentorship hasmuchmoredramaticconsequences.
Meta Knight in the Kirbyanime counted as this early on (before he revealed himself to be good, of course), and was only working for King Dedede to stop the monsters ordered from Nightmare Enterprises/Holy Nightmare Company while keeping on the king's good side. Once Kirby came into the picture, Meta Knight also ended up training him. Of course, King Dedede was so stupid he didn't figure it out, even after The Reveal.
Shina Dark has the rare protagonist Exoda acting like this to the entire citizens of Shina Dark. The only one however who could see what he really was trying to do is his butler.
S-cry-ed features a deathmatch near the end of the series between Ryuho and Jigmar. When he loses, Jigmar confesses that he only fought in order to make Ryuho realize his full potential.
A rather dark mentoring in Hunter × Hunter for Gon and Killua at the hands of Combat Sadomasochist and Evil Clown Hisoka, who does whatever he can too drive and move Gon to become even stronger, with the ultimate goal of waiting for him to become just as strong as he his, so he can fully enjoy killing him. To make this clear how terrible this will be Gon fighting him right now, when he's extremely weak, gives Hisokaboners.
This is allegedly Zoom (the second Reverse Flash)'s modus operandi. He claims that he wants to make the Flash stronger. Mostly he just goes around killing people — which is, as luck would have it, exactly what his philosophy calls for. Zoom wants to, as he would put it, "make Walllllly abetterhero thrrrrough tragedyyyy", or by forcing him to deal with tragedy.
Mr. Miyagi's training in The Karate Kid has been moved to the discussion section; don't think we haven't thought of it.
The Joker in The Dark Knight claims to be this to Gotham and more specifically, to Harvey Dent. But then again, he is The Joker.
Ryan Bingham (George Clooney) in Up in the Air seems to be the hero (or antihero) but he is in fact the mentor to the actual hero, Natalie Keener (Anna Kendrick).
Jigsaw from the Saw movies sees himself as this, more so for some individuals than others. It almost never works, and, except in some cases, he doesn't feel any remorse or disappointment when they fail and die.
In the intro sequence for Indiana Jones and the Last Crusade, Fedora starts out as a Worthy Opponent for Young Indy, but crosses over into Stealth Mentor territory at the very end. When he sees the Sheriff take the Cross of Coronado and place it in the hands of Fedora's boss, Panama Hat, the other cronies whoop with victory, but Fedora approaches Indy when the others are gone, and passes him the iconic hat Indy is known for wearing.
Fedora: You lost today, kid. But that doesn't mean you have to like it.
Mrs. Lorelei Granger, the strict teacher in the novel Frindle.
In the Harry Potter series, Severus Snape displays elements of this, hating Harry but ultimately being an effective teacher. Snape taught Harry how to duel and Expelliarmus and the spell he's "most famous for", saved Harry countless times and inadvertently gave him the poison lesson that eventually saved Ron's life.
Also (Sort of) inverted with the fake Mad-Eye Moody in Goblet of Fire.
In Ender's Game, Mazer Rackham does this to Ender, with the difference that he fully acknowledges his aim from the beginning in the page quote.
It's not just Mazer Rackham. Colonel Graff, who is the head of Battle School, uses this as standard operating procedure. He's specifically ordered all the adults in Battle School to do everything they can to make Ender as miserable as possible and never, ever come to his aid - even to save his life.
Jeb Batchelder of the Maximum Ride series of novels does this so many times (and Double Subverts it almost as often) it's almost become an Overly Long Gag.
A short story based on Magic: The Gathering featured a wizard who had fought a battle against another for time immemorial. When his opponent surrenders, he finds out that his opponent was his creator and had merely been training him to fight a battle that the creator found too frightening to even contemplate. The story ends with temporary peace having been found with the creator wizard's destruction, but the creation staring out and waiting for the new host to arrive...
In Logan's Run, the Sandman who has been tracking Logan and Jessica through their run turns out to be Ballard, the man who's "lived a double lifetime" and shuttles those who can survive away from Earth to Sanctuary.
Live Action TV
Heroes has a literal stealth mentor: Claude, who teaches Peter how to fully use his power copying ability, has the power of invisibility. And whacking Peter with a broomstick, which is a power many fans wish they had.
Mahou Sentai Magiranger has The Dragon Wolzard do this subconsciously. Turns out he's actually the Magirangers' presumed-dead father gone Brainwashed and Crazy, and his suppressed good side is what forces him to act as a mentor to the Magirangers even as he tries to kill them.
The musical The Fantasticks has the romantic version.
inFamous: As it would turn out, big bad Kessler was actually Cole, who travelled back in time to prepare his younger self to fight an even worse villain in the future, he does this by destroying his own home city, killing the younger version of his own wife/Cole's girlfriend, and making Cole fight several post-apocalyptic factions.
"Dr. Polito/SHODAN from System Shock 2, who pretty much uses you to destroy an alien race that's infected the ship.
Dimentio in Super Paper Mario. His early monologues and actions reveal that he is trying to secretly help Mario and the other heroes become stronger in order to defeat Big Bad Count Bleck. His motives, however, are less than pleasant. (Unfortunately, this is undermined by the same scene in which he pulls The (fake) Reveal on the heroes. After explaining his intent to defeat Bleck, he asks them for their help. Agreeing repeatedly results in a Nonstandard Game Over. Oops.)
That's less of an undermining than it seems. Before and during his request the game drops a few blatant hints (and then, I believe, outright says, since the game lays a lampshade on everything) that he wants to kill Bleck to follow his own plans or world domination, so it's less that the game ruins the Reveal more that it we pretty figured it out (or at least realized he couldn't be trusted) earlier and were waiting for it to be fully explained.
This is ProtoMan's MO in the original Mega Man games. In 7 he even gives Mega Man his Proto Shield if he beats him, and admits that his brother has nothing left to learn.
In Dissidia: Final Fantasy, Golbez is given this role, because it would be extremely awkward if after all that happened in his original game about him making peace with Cecil in the end of the game (as well as being revealed as his brother), he'd willingly turn his back and smack Cecil around For the Evulz. He's also the only villain who has a different 'death' cutscene, in which he doesn't vanish with dark energy, but just retreats.
Nero from My World My Way is a mentor-in-secret to the game's Spoiled Brat protagonist. The player can even choose what type of "help" he gives her at the end of each level (usually in the form of a quickie boss battle).
Ingram is another particularly interesting example, in that he actually begins as a mentor character before betraying the party and revealing that he only helped train the heroes so that they'd be more useful when they were brainwashed and integrated into the Aerogaters' army. He even admits that he's continuing to train them by being their enemy. Of course, he's actually counting on them winning.
This is pretty much Kratos's main motive in Tales of Symphonia. And, to a lesser extent, Yuan's (although both have other reasons for acting the antagonist).
In Lunar: Eternal Blue, Ghaleon plays this role. He's unable to directly oppose the Big Bad himself because he died 1000 years earlier, when he was the Big Bad of the first game of the series. Zophar's magic restored him to life to act as his Dragon, and Zophar can withdraw that magic at any time he chooses, instantly killing Ghaleon. Thus, his only option is to go along with Zophar's plans while providing enough covert training to the heroes that they can defeat his new boss. Once the heroes figure out what he's up to, he admits it, since they're now strong enough, happily fading away to join his long-dead best friend Dyne in death.
Grahf in Xenogearspowered up lots of bosses and had them fight you in order to strengthen Fei up, but its averted when you discover that he was only making Fei strong enough so it could be worth taking his body to use for himself since Fei was his reincarnation.
Albedo in Xenosagaput Jr. (aka Rubedo) through all sorts of hell in order to force him to deal with and resolve his emotional issues and mend their tortured relationship. Though by mend, Albedo meant "provoke Jr. into killing him", since Albedo is otherwise immortal and Jr. is his only anti-existence. He basically spends the majority of Episodes I & II teaching Jr. exactly how to kill him, then prodding into a place where he's mentally-ready to kill him. And then with his dying breath he pretty much tells Jr. to go use what he's taught him against the real bad guys. Ah, brotherly love.
In Castlevania: Lords of Shadowthe Old God Pan, after aiding you throughout the game suddenly attacks you at the gates of the Land of the Dead. Throughout the battle he tests Gabriel's prowess and shows him the proper way to fight against another wielder of Light and Shadow Magic. All so that Gabriel will be prepared to face the true Big BadSatan.
Although his role varies from game to game, Meta Knight is sometimes implied to be this to Kirby - most notably in Kirby's Adventure, where he shows up to toss Kirby invincibility lollipops about as often as he sends his underlings to attack him.
In Westwood Studio's 1997 game based on the film Blade Runner, Graf acts as one to the protagonist Ray McCoy.
Played with in Radiant Historia. Heiss thinks he's doing this, but he didn't count on his protege disagreeing with him once he revealed his real motives and continuing to oppose his plans.
Devil Survivor: Gigolo, also known as Loki, takes on this role. He explains the situation with the Bels, tells you about the Devil's Fuge (indirectly saving your life) and explains the different paths and their outcomes near the end of the game. And while he pretends everything he does is because it amuses him, he gives the Player Character one hell of a What the Hell, Hero? if you decide to listen to Yuzu and run away from your responsibilities, disregarding all his good advice in the process. The fact that you can fuse him after you defeat him can be interpreted as a his way of giving you even more help to not screw things up in your New Game+.
Arguably, Archer from Fate/stay night is this to Shirou — in the anime at least, and in the visual novel. Even though he REALLY is intent on killing him so he won't repeat his own mistakes, he DOES give pretty helpful advice to him in the form of spiteful comments, and ultimately helps Shirou awaken his powers. No best stealth mentor than your aloof Future Badass self. It also should be noted that in one scenarios, he discards his personal vendetta in face of a greater threat, and because at this point Shirou will most likely never, ever, turn into Archer.
Beatrice turns out to be this for Battler in Umineko no Naku Koro ni, despite spending the first half of the series as a sadistic Troll. It was all an act; she wanted Battler to win the game they were playing, but unfortunately he doesn't realize this until she's dead.
Vriska in Homestuck uses this justification to explain some of her eviller acts, like giving the main antagonist the powers of a god just so John, her student, would have to become stronger to beat him. Deconstructed in that it's shown to be the egotistical madness that it was, and none of the other characters approve of her actions.
Scavenger in Transformers Armada takes this role for a while. During which he helps the Decepticons get their hands on a superweapon (and even makes sure Megatron will use it personally!), which is probably the only reason they believed he was on their side, given that his behavior towards Hot Shot would be downright bizarre if he wasn't secretly an Autobot.
It was also pretty cleverly done in terms of the character's physical design. In the G1 series, Scavenger was a Decepticon and transformed into a green and purple construction vehicle. In Armada, Scavenger was a (fake) Decepticon and transformed into a green and purple construction vehicle. The Genre Savvy denizens of the other side of the fourth wall would, of course, jump to the conclusion that he was a Decepticon in homage to the G1 character.
Proto Man in the Mega Man cartoon might be considered one at few times but it's highly debatable (maybe if it would have been finished one could judge reliably.
Discord of all characters acted like one in the Season 4 premiere of My Little Pony: Friendship Is Magic. Whether he was just dicking her around for his own amusement or legitimately trying to help is up in the air, but he definitely did tell her exactly what she needed to hear to succeed.
In security parlance, a Red Team is a group that launches fake attacks against various assets in order to gauge responses and test security holes. What puts them in this trope is that the attacked group doesn't know that it's a fake attack until it's over (just as they would in real life).