His original name was Smeagol. After discovering the Lord of the Rings and possessing it, he fell and called himself Gollum. The detailed plot of the movie can be found at the beginning of the third film "The Lord of the Rings - The Return of the King".
The following are some
references:
A long time ago, Gollum was a hobbit. His original name was Smeagol. Once while fishing with his friend Diego, Diego was pulled into the water by a big fish and found the Lord of the Rings buried in the sand. Gonari regained the Ring, finally killed Diego, got the Ring, and then told his friends that it was his birthday present. As a result, his murder was known to others, so Smeagol was expelled from the country and exiled to the deep mountains and forests. However, the temptation of the Lord of the Rings changed his shape and gradually turned into a monster named Gollum. He forgot the taste of bread and began to eat fish. He lived in the cave for 500 years, but the Lord of the Rings got tired of him and never stopped. He escaped there and was discovered by Bilbo Baggins. From then on, Gollum began his "journey" to search for the treasure. Later, the Lord of the Rings was passed into the hands of Frodo. When Frodo learned about the harm of the Ring, he began his journey to destroy the Ring. Gollum has been following him and his friend Sam who destroyed the Ring, but until the third The second part really shows up.