From the episode Fragile Balance:
A teenage boy shows up at the S.G.C. claiming to be Jack O'Neill, sending the team on a mission to uncover his true identity.
General Hammond introduces Major Carter to a young man who has breached the based security, using Colonel Jack O'Neill's own security pass. He's about 15 years old, and sitting in a holding room wearing baggy, adult-sized clothes. He claims to be Jack O'Neill.
SG-1 is obviously skeptical, but young "Jack" certainly talks and acts like their fearless leader. And he knows things that no civilian would know: Carter's experience as Tok'ra host ("In the Line of Duty"), Daniel's ascension and punishment ("Fallen"), and Teal'c's new reliance on tretonin after the loss of his symbiote ("The Changeling"). Jack is granted limited access to the base while Dr. Fraiser runs tests to support or disprove his story.
It seems to check out. His DNA is a nearly identical match for Colonel O'Neill's, except for a small abnormality. Jack wants to know why he woke up 30 years younger, and who has done this to him. SG-1 visits Jack's house to retrace his steps, asking him what he did the previous night. They come up empty -- but Jack does have a memory flash, and sees a group of swirling green lights ... and an Asgard.
O'Neill is scheduled to conduct a briefing with the new F-302 pilots -- but Hammond has removed him from active duty, and Carter conducts the meeting. Despite the decision, Jack interrupts the briefing. At first, the pilots won't take him seriously -- but when he obviously knows what he's talking about, they listen up and begin to take his instructions.
Fraiser soon reports with additional test results: young Jack's genetic structure is inexplicably breaking down, and he is dying. Jacob Carter arrives from the Tok'ra to present him with the only option they have. They offer to put Jack into stasis to save his life, until they better understand what is happening to his body. After his previous experience putting his life in the hands of the Tok'ra ("Frozen," "Abyss"), he asks for a few minutes to think about it -- then escapes the base and flees into the nearby town.
Jack is unable even to buy a simple bottle of beer, even when he runs into an old Air Force friend and pretends to be O'Neill's nephew. The rest of SG-1 finally tracks him down sitting by a creek, fishing. They tell him what Jacob determined after looking at his test results: he is a clone of the real colonel, who is probably still being held by the Asgard. Jack refuses to hand himself over to the Tok'ra again. But his friends have been doing some digging, and have a new plan.
Daniel and Teal'c have discovered that the details of Jack's abduction memory are striking similar to several other UFO abduction stories. They visit several alleged abductees, who tell very similar stories -- being taken in their sleep, held motionless in mid-air, four swirling, green lights ... and an alien resembling an Asgard. The last such abduction was 19 years ago; and with each abduction, the person was taken again seven days later.
Armed with a zat gun, young Jack waits in his bedroom on the seventh day, while the rest of the team monitors him from outside the house. There is a flash of light, and an Asgard transporter brings him onto a ship in orbit, returning the real colonel to his bed. The unknown Asgard approaches young Jack, suspended in mid-air, and tells him not to be afraid. Jack zats him, escapes his restrains, and transports SG-1 aboard.
They signal Thor for assistance. When the Asgard wakes up, they confront him. His name is Loki, and he is a scientist who has been studying human evolution to try and solve the Asgard's own fatal cloning problem -- which will eventually result in their extinction. He says that their bodies were once much like humans are now, and that Jack O'Neill is legendary among the Asgard as representing the next stage in human evolution (as his brain was capable of receiving the library of the Ancients ["The Fifth Race"]).
Thor arrives, and tells SG-1 that Loki is a renegade who was convicted of performing unsanctioned experiments on humans 19 years ago. Loki replaces his abductees with a clone for one week, so that he may study the person he has taken -- but the clones are unstable, and never survive. Jack's clone failed to properly reach the correct maturity because the Asgard have tagged his DNA to prevent tampering -- thus the anomaly that Dr. Fraiser found.
Thor agrees to try and correct the flaw in young Jack's DNA, and the procedure is a success. Young Jack decides to live his life over again, and returns to high school. He and the colonel agree not to stay in touch -- it would be too weird.
** episode synopsis borrowed from Gateworld.net
Incorporating all of Jack O'Neill's memories and personality, the O'Neill clone was conceived by the Asgard scientist Loki and transported to Earth. While Loki studied the real O'Neill, his clone was to take his place on Earth for one week's time. For O'Neill's own protection, the Asgard had placed a marker in his DNA to prevent any attempts in genetic manipulation. Loki, not realizing this, duplicated O'Neill nevertheless -- and as a result, the clone was rapidly matured only to about age 15, instead of the colonel's actual age.
The duplicate, not realizing he was a clone, went to the S.G.C. looking for answers, and soon discovered a flaw in his DNA that was going to kill him. At O'Neill's request, Thor repaired the genetic defect. The Air Force took O'Neill's young clone under their wing to provide for his future, and he returned to high school to live his adolescence over again.
** bio borrowed from Gateworld.net Omnipedia