Character Analysis
Sweetie Pie
On the surface, Danny is your typical cute bowl-cut haired little boy. As his mother Wendy tells us though, Danny has had trouble socializing ever since he missed some of his early time at nursery school due to an injury.
So as she puts it, this is when Danny first started talking to an imaginary friend instead of making real friends:
"I guess that's about the time when I first noticed that he was talking to Tony."
And as we can see from Danny himself, he doesn't have a lot of real friends, as he says to his mom,
"Anyway, there's hardly anybody to play with around here."
So now it looks like it's Danny and his friend Tony versus the world, especially now that they're going to move to a completely isolated hotel for the entire winter. Worse yet, Danny can get a bit defensive when people ask him to talk about Tony, saying,
"I don't want to talk about Tony anymore."
Danny's relationship with Tony might seem really sweet (if a little sad), but we can tell pretty early on that there's something a little sinister about this imaginary friend.
Tony Time
So you can't really talk about Danny without also talking about Tony, since Tony spends just as much time talking through Danny's mouth as Danny does. (Also, Tony bizarrely lives in Danny's mouth.) When Danny's asked to explain how Tony communicates with him, Danny says,
"It's like I go to sleep, and he shows me things but when I wake up, I can't remember everything."
So Danny and Tony's relationship sounds eerily like some sort of demonic possession. It's like Tony can take over Danny's thoughts and actions whenever he wants.
The more insane Danny's situation becomes at the Overlook Hotel, the more Tony seems to take over. At one point, Danny seems to disappear entirely, as his mom Wendy asks him what's wrong and Tony freakily replies
"Danny's not here, Mrs. Torrance."
At this point, Wendy becomes truly concerned and tries to get Danny to a doctor. But little does she know that Tony is trying to warn her about her husband's coming murder spree. After all, Tony apparently knows how to foretell the future.
Prophet
So yeah, Danny's imaginary friend Tony might not be so imaginary after all. In fact, he might be some sort of supernatural being who can take possession of Danny's body whenever he wants. The first hint we get of this comes when Danny asks Tony if he thinks his dad Jack will get the job at the Overlook Hotel. Tony answers,
"Yeah, he already did. He's gonna phone Wendy up in a few minutes to tell her."
And sure enough, the phone rings and it's Jack saying he's got the job. Now this could just be a lucky guess on Danny's part, but it's more likely (this being a Kubrick movie and all) that something else is going on.
Toward the end of the movie, Tony pretty much takes over Danny entirely and starts shouting "Redrum! Redrum!" which is just the word "murder" backwards. Once again, Tony has seen the danger of the Torrances' situation long before any of the Torrances have.
Danny's Timeline