From what I feel the whole book revolves around friendship and trust.
Gollum ended up alone after murdering his....I suppose... best friend. Merry, Pippin and Samwise have seen the ring but are not tempted into wresting it from Frodo. Wellllll I suppose Merry would have worn it just to see what would happen..
Frodo needed someone to guide him into the right path and a partner to ensure the darkness doesn't claim him. Smeagol/Gollum is unfortunately our desires that makes us greedy for more and more. Whether for more sweets or temporal power and wealth.