Although we know very little of the TLK plot what we do know is that Optimus turns against the Autobots and Humanity, this can be assumed from the trailer. Most theories seem to indicate that Optimus is being controlled by a greater force (Creators? Unicron?). Although these theories are very logical and most likely to happen I would prefer a scenario in which Optimus chooses to turn "evil" on his own. This turn to the "evil" side however is something that the movies have been unintentionally building up, although the Decepticons themselves are "evil" we see that one of Megatrons goals is to save his race as seen in ROTF, "My master, I failed you on Earth. The Allspark is destroyed and without it, our race will perish." Unlike Optimus Megatron acknowledges the approaching extinction of his race and wishes to preserve it even if it means following an "evil" agenda, Megatron later asks Optimus a question that is quite important to this theory, "Is the future of our race not worth a single human life?" Of course this is just Megatron taunting Optimus but it's also a way to make Optimus question who's side he's really on, he's saving humanity but in doing so he's stopping his race from having a future, even if it's under megatrons rule it would bring life back to cybertron and save his race. A bigger influence than Megtron however is Sentinel Prime, the father/Mentor figure to Optimus, many would say he's "evil" after all he is working with Megatron, but let's be wise to remember one thing, he's working with him not for him, "What you must realize my Autobot brothers, is we were never going to win the war! For the sake of our planet's survival, a deal had to be made... with Megatron" The purpose of this deal was not personal gain or power but only to preserve the cybertronian race, sentinel saw the reality of the war and accepted that the survival of his race was worth destroying a planet for. "For Cyberton! For our home! What war destroyed, we can rebuild - but only if we join with the Decepticons" "No, it's not the only way! This is our home, we must defend the humans" Optimus recognizes why Sentinel is doing what he does and even tries to sway him to his side by insisting that siding with the Decepticons isn't the only way, however by doing so Optimus is essentially declining an end to the war, a chance for the Autobots and Decepticons to put their weapons down and call a truce, a chance to let their race flourish once again. "I bring you Cybertron, your home, and still you choose humanity" This quote basically summarizes the running idea that is presented to Optimus in DOTM, he is given a chance to save his race but he chooses humanity, now to build on to this I'd like to take us back to G1, yes they are different transformer continuities but Optimus was presented with the same dilemma, and what did he do? He gave in, Megatron gave Optimus the opportunity to save cybertron and Optimus himself pressed the button to transport Cybertron to earth, "If you don't you will be responsible for Cybertrons destruction" (G1) In the movies however Optimus does not agree to any chance of saving cybertron and from what he have heard about TLK he believes himself to be responsible for the state in which he finds Cybertron presumably after the events of DOTM. Before we reach TLK however we have to visit AOE, this is where we really see Optimus begin to realize that his race is endangered, during the KSI raid he states, "They’re not your property! They were my friends." Of course this is most likely referring to Ratchet but it can be seen as a reference to all the transformers KSI got their hands on, let's not forget they had Megatron who despite all he did was still at some point his brother in arms, Sentinel his mentor and many others we may not have seen. What KSI was doing was essentially unethical in the eyes of Optimus, his fellow cybertronians were being killed and harvested, it really was cruel. This leads to Optimus not only losing faith in humanity but also gives him a chance to save his autobots that remain. "We’re retrieving the Seed, but then we’re done defending the humans." We see that he plans on leaving, he's taking his Autobots elsewhere, he doesn't want anymore of them to be sacrificed for humanity, this is his way of saving them without doing anything "evil". Later Lockdown presents a previous idea that has been presented to Optimus before by Megatron and Sentinel, the idea of shame. "You saved the human instead of saving yourself. You bring shame upon us all." This shows us that Optimus could be seen as a traitor to the cybertronian race, he has been criticized by three cybertronians, each from different affiliations, Megatron from the decepticons, Sentinel who despite everything could still fall under the autobot affiliation, and lockdown the character who would be most like a normal citizen of cybertron as he has no affiliation with either side. So now we finally reach TLK, Optimus has found Cybertron, it is a barren wasteland, his race is dying, he has let down his race, he who fought a war to bring peace to his planet has destroyed it instead, he realizes what he has done and now he has to do something, something that Sentinel himself said Optimus couldn't do. "Always the bravest of us, but you could never make the hard decisions!"
I think having Optimus be truly evil would be a bad idea. Having Optimus being controlled by the Quintessons or another sinister force would gel much better with Lockdown telling Prime "You were built to do what you were told," and the Cybertronians being built as a race of slaves. Also, I wouldn't call Prime a traitor. I think he would rather not save Cybertron or the Cybertronian race if it means destroying other species and worlds, but if there were a way his race and world could be saved without destroying humanity or expanding Megatron's or the Quintessons' tyranny he would happily do so.
Well ever since ROTF they've been hinting at Optimus Prime's eventual fall into evil. Each movie Optimus grows more aggressive and darker in personality, and it's obvious that movie Primes are subject to corruption, The Fallen, and Sentinal Prime being great examples. There seems to be an inherit flaw in the Primes and that many of the, just turn evil over time.
The same can be said for The Fallen too. While The Fallen is seen as the Villain of the Movie betraying his brothers and trying to kill humans breaking their one rule to never destroy a planet with life. From The Fallen's point of the view the other Primes betrayed him choosing the Humans instead of the future of their race. He felt what he was doing was for his people. Like Zod in Man of Steel.
I still think it would be super dumb if he willingly just turns evil on his own...especially after the OBVIOUS FORESHADOWING IN THE LAST MOVIE THAT POINTS TO THE QUINTS USING MIND CONTROLLED ROBOTS, FOR GOD'S SAKE. Just let Optimus be an aggressive and flawed hero, goddamn.
I doubt he is evil. But I wouldn't be surprised if in TF5 Optimus had snapped. This version of Optimus Prime gets a lot of flak for being angry and aggressive, but the thing is the script writes him into circumstances where he becomes that way. If you were betrayed by your mentor (DOTM) and later be turned into a fugitive and had your friends melted down (AOE) you would be angry and downhearted too. Optimus has gone from "they're a young race, but I've seen goodness in them" to "we're done with them." The writers don't really help in making scripts that portray the human race as hostile and selfish in the face of Decepticon invasion. It's going to take some serious goodness from humanity (Cade, Lennox, Epps, etc) to restore Optimus's faith in them.
Except Optimus' faith is already restored which is the whole reason why he left Earth in the first place, to keep it safe from the creators hence the whole "Leave Earth alone." His faith in humans was restored by Cade and his family's actions over the course of the film, but mostly Cade. Even from the beginning when Cade was planning to take him apart for his own studies only because he believed Optimus was already dead, Optimus was shown a bit of good when Cade saw he was truly alive and was someone who desperately needed help. Cade kept constantly showing Optimus the good he was originally fighting for and even have him the advice to look past the bad of humanity and still see the good that remains. That's why in the end he was willing to protect Cade even if it meant killing another human, to protect the good he originally swore to protect. So I'll go with no, Optimus isn't going to turn willingly evil. Besides I have a huge counterpoint to debunk this. If Optimus did turn willingly evil why would he try to kill Bumblebee? We know that Optimus considers Bumblebee like his son, so why would he want to kill him. Sure one could say it's because Bumblebee is against him, but remember not even Sentinel had the heart to kill Optimus until he believe he had no other choice. Yes Sentinel beat up Optimus pretty bad but he still viewed him as a student and gave him multiple chances to turn back on the humans. So Optimus wouldn't decide instantly the moment Bumblebee opposed him that he needed to die because I think that scene we saw was a few moments after Optimus turned against them.
When I saw the trailer where Optimus attacking Bumblebee, I figured he must be under some kind of mind control.