The central twist of "Memento" is the revelation that Leonard is not a reliable narrator and has been actively manipulating his own investigation. The final confrontation with Teddy, which occurs at the chronological beginning of the color timeline, reframes the entire film.
Teddy reveals several key truths: First, he was the lead police officer on Leonard's case. Second, he helped Leonard find and kill the real second attacker over a year ago. Leonard has a faded Polaroid of himself, smiling and pointing to a spot on his chest, commemorating the moment before he got a tattoo celebrating the successful revenge, which he then chose to forget. Third, and most devastatingly, the story of Sammy Jankis is a confabulation. Teddy claims Sammy was a real fraud Leonard investigated, but he was unmarried. The story of the wife with diabetes who died from repeated insulin injections is actually Leonard's own. His wife survived the attack, but became distraught over Leonard's condition and tested him, leading to her accidental death at his hands.
Faced with this unbearable truth—that his wife's death was a tragic accident of his own making and that his quest for revenge is a meaningless charade—Leonard makes a conscious choice. He burns the photograph of his successful revenge and the photo of Jimmy Grantz's body. He then decides to create a new purpose for himself. He takes out his notepad and on the back of Teddy's picture, he writes, "Don't believe his lies." He then jots down Teddy's license plate number, identifying it as the killer's, and drives off to get it tattooed. He chooses to make Teddy his next "John G," deliberately setting his future self on a path to murder him. The film's opening scene, where Leonard kills Teddy, is the direct result of this choice. Leonard is trapped in a loop not just by his condition, but by his own need for a reality he can live with, even if it is a lie. His 'system' is not a tool for finding truth, but for creating it.