Once, Gollum was called Smeagol. In those days, he was a hobbit of the Stoor settlement near the Gladden Fields. One day while out fishing with his cousin, Deagol, the pair found the One Ring, and Smeagol murdered Deagol for it. He was then shunned and cast out by his family, hiding himself in the Misty Mountains. It was there that he earned the name Gollum, because of the disgusting noise he made in his throat.
For five hundred years, the Ring twisted Gollum and poisoned his mind; he called it his "Precious." However, one day the Ring abandoned him and came to the hobbit Bilbo Baggins. Gollum encountered Bilbo, lost in the mountains and held a riddle contest with him. Gollum lost, but decided to kill Bilbo and eat him anyway. Upon discovering "his Precious" missing and Bilbo gone, Gollum cursed the name Baggins.
Eventually Gollum emerged from the Misty Mountains, his need for the Ring overcoming his hatred and fear of the sun, moon and all else. While searching he was captured by Sauron and brought to Barad-dur, where he was interrogated and tortured by Sauron himself. From Gollum, Sauron learned the names "Shire" and "Baggins." Sauron released Gollum, hoping Gollum would lead him to the Ring.
While Gollum was escaping Mordor, he stumbled into Shelob's tunnel. The great spider spared his life when Gollum promised to bring her food. While wandering through Middle-Earth, Gollum was captured by Aragorn who turned him over to Gandalf the Grey. Gandalf learned of Gollum's capture and interrogation by Sauron, and then gave Gollum over to the Elves of the Woodland Realm of Mirkwood.
But during a raid by Orcs, Gollum escaped and immediately began his search for the Ring. He caught up with Frodo Baggins and the Fellowship of the Ring at the West Gate of Moria, and followed them through the mines, through Lothlorien, and down the River Anduin.
He continued to follow Frodo and Samwise Gamgee through the Emyn Muil. Gollum was captured by Frodo and Sam, whereupon he swore to serve Frodo out of fear of him and to ensure that Sauron did not re-claim the Ring.
Gollum led the Hobbits to the Black Gate of Mordor, and afterwards through Ithilien to the Morgul Vale and to the Pass of Cirith Ungol. It was here that he betrayed the hobbits, and led them straight into Shelob's lair, hoping to recover the Ring when Shelob discarded of the Hobbits' bones and clothing. His plan failed, and he pursued the two hobbits to Mount Doom where he ambushed them. However, deep in the Sammath Naur, Frodo claimed the Ring; Gollum attacked him, and in the struggle bit off his finger and thus claimed the Ring.
While rejoicing at being reunited with his Precious, fate intervened and Gollum fell into the Cracks of Doom, destroying both himself and the Ring.