|Metal Sonic did not originate from fanon, and more information can be found on their respective wiki(s). You may read more about it on the following wiki(s):|
Metal Sonic is a powerful robot created by Dr. Eggman, for the sole purpose to kill the famous Sonic the Hedgehog and assist his creator in world domination. However, he has betrayed Eggman a few times to conquer Mobius on his own.
Metal Sonic will do anything to make sure Sonic is out of the way, even if it means wiping out Eggman. There are times when he still follows his orders, but this is usually for his own purposes.
Metal Sonic makes an appearance in Team Badnik in Sonic Heroes 2. Here, he has the ability to talk, and talks much; his angst about having been abandoned by Team Eggman catalyzes incense in the rest of the team. Much of this storyline involves preparing assault on Team Eggman.
Metal Sonic appears as the main villlain in Sonic Generations 2, and sends Sonic to a land when time is frozen. In the end, Metal transforms into a Super form of himself, but ultimatly fails to destroy Sonic and fulfill his reason of creation. After the credits, Metal gets into a humorous conversion with his Classic and Modern form of his own creator involving who's plan was better in the first place, how the Modern Eggman should have never created Metal, and the Classic Eggman, unaware of Metal's previous betrayal, arguing with his Modern self that Metal is an excellent creation.
Metal Sonic appears as the main character in Metal (2013 game). In the game, he can protect the Earth, or make evil choices and stay the way his currently is. He roams Station Square, defeating Dr. Eggman's robots, and everything in his way. He can transform into Neo Metal Sonic and upgrade himself in Tails' old workshop. In the story, he rampages trying to find Sonic, but is defeat by the hedgehog. He then defeats Shadow, Dr. Eggman's robots, and Silver Sonic II, and collects six Chaos Emeralds before destroying the Death Egg in space, or even destroying Dr. Eggman, depending on what choices he makes.
Metal Sonic appears as a secondary antagonist in Sonic's Story and the main protagonist in Metal Sonic's Story. In Metal Sonic's Story, Robotnik rebuilds Metal Sonic after his defeat in Stardust Speedway, and programs him to obtain the Chaos Emeralds and defeat Sonic at all costs. So Metal Sonic goes on forth to defeat Sonic, goes as far as to destroying anything in his way, including Robotnik's badniks. Robotnik's bosses are replaced with EggRobos. After collecting all 6 Chaos Emeralds, Metal Sonic meets up with Sonic in Steam Terminal, Robotnik's new base. Sonic has already defeated Robotnik, and the station is starting to explode. As Metal Sonic and Sonic race to the exit, both barely escaping. If Metal Sonic hasn't obtained the Chaos Emeralds, Sonic has obtained them and restored peace to South Island. If Metal Sonic has collected them, he aids Robotnik in fueling his ultimate weapon, making the entire South Island under Robotnik's control.
In Sonic's Story, Metal Sonic occasionally attempts to stop Sonic as opposed to Robotnik, but to no avail, Sonic beats him. Eventually, after Sonic beats Robotnik, the doctor retreats to the Nuclear Nucleus, where him, Sonic, and Metal Sonic meet. Robotnik and Metal Sonic battle against Sonic, and Sonic eventually defeats both Robotnik and Metal Sonic. Sonic escapes out of the facility, restoring peace for South Island.