When I watched one of the Lord of the Rings films (don't remember which one), I saw Sméagol talking to himself and it made me feel uncomfortable.
Why does Sméagol talk to himself?
He has a split personality, created after he had been under the influence of 'The One Ring'.
Smeagol was originally a Stoor, a type of hobbit, until he became bearer of the One Ring after murdering his cousin and stealing it from him after he (the cousin, Deagol) found it while they were both fishing in the Gladden Fields on Smeagols birthday.
After Smeagol took possession, it continued to corrupt his body and mind, forcing him to retreat below the Misty Mountains where he continued to live in the dark for a further (and unnatural) 400 years.
From The Lord Of The Rings Wiki...
During his centuries under the Ring's influence, he developed a sort of dissociative identity disorder: Sméagol, his "good" personality, still vaguely remembered things like friendship and love, while Gollum, his "bad" personality, was a slave to the Ring and would kill anyone who tried to take it. Years later, Samwise Gamgee would name the good personality "Slinker" (for his fawning, eager-to-please demeanor), and the bad personality "Stinker". The two personalities often quarreled when he talked to himself (as Tolkien put it, "through not having anyone else to speak to") and had a love/hate relationship, mirroring Gollum's love and hatred for the Ring and for himself.
It is essentially a visual way of representing Gollum's internal conflict. For the films his dialogue with himself are a convenient and visual way to get across what is revealed in a fairly subtle way over several chapters of book.
It is based on, but not identical to, various references in the books. After Gollum is captured by Frodo and Sam and promises to help them it is implied that the power of the ring forces him to keep at least to the letter of his promise against his own inclination to take the Ring for himself.
Initially he adopts a much more helpful and friendly attitude which Sam is suspicious of, justifiably as it turns out, but there are also hints that some of his old personality of Smeagol, a hobbit-like creature, are coming back. Something which Frodo is keen to encourage and believe as it gives him hope that the power of the Ring isn't absolute.
It also reinforces the power that the Ring has over people who hold it, at a critical point in the story where Frodo is coming more and more under its influence. The implicit threat being that he could become another Gollum himself.
It is also an effective and economical (in terms of screen time) way of turning Gollum in to a more relatable character, who has been psychologically damaged by the Ring and is a bit more complex than just a villainous monster. In the books Gollum has a more detailed backstory.
The self dialogue scenes are a very effective way to make the Smeagol aspect of Gollum a bit more of a sympathetic character while still being a very real threat to Frodo and Sam.