In the Lord of the Rings trilogy, the ring is the worst sin of all....the sin of pride. And Gollum represents what pride can do to someone. It can take a peaceful, hobbit-like creature and make him into a hideous, self-loathing hermit with a bifurcated personality.
Then again, no. Nor pride nor the ring did this to Gollum, he did it to himself. He let the ring do it. The ring was so powerful that no being, even Frodo, could resist it (witness Frodo's attempt at the end to appropriate the ring for himself; witness also the fact he never recovered from his tenure as ring bearer).
Gollum is an example of pride. Pride is normally defined (i.e., when it is defined as a vice and not something to be, well, proud of, like good grades.....I once got a "Pride Scholarship") as inordinate self-love. Why do I characterize Gollum's pride as self-loathing?
Because "love" is the wrong word for what pride represents. It represents self-worship, and self-worship, when the self is not a fit object to be worshiped, becomes self-imprisonment, or worship of a fetish, in this case, the self. He imprisons himself with himself and hates himself for it.
Gollum was so enthralled with his "precious" that he structured his whole life around it, retreated to the dark recesses of "Middle Earth" to be alone with it, and saw himself as another, different from himself. He saw himself as the ring, and he worshiped the ring. Such was the meaning of Tolkien's choice to write Gollum's internal dialogue/monologue with "we" instead of "I" as the subject.
Gollum, when we meet him in The Hobbit and when we see him in the later works, is in Hell. He is caught up in his own cycle of self-worship and self-hatred.