Before becoming known as Gollum, Tolkien’s character had the name Sméagol. He was a member of a river-dwelling people related to Hobbits and acquired the One Ring after a fishing expedition with his cousin Déagol.
In The Lord of the Rings, Déagol discovers the Ring in the Anduin. Sméagol wants it because it is his birthday, but when Déagol refuses to give it to him, Sméagol kills him and takes the Ring. His relatives eventually drive him away because of his secrecy and harmful behavior.
Sméagol retreats beneath the Misty Mountains, where the Ring’s influence and his long isolation transform him. He develops the repeated “gollum” sound that becomes his identifying nickname. Tolkien uses both names to show the tension between the creature’s earlier identity and the personality shaped by possession of the Ring.
Déagol is not an earlier name for Gollum; he is the cousin whom Sméagol kills. The name Gollum therefore refers to Sméagol after his transformation, not to a separate species or person.