What's Up With the Ending?
HE WAS DEAD THE WHOLE TIME.
Whew.
Yep—it's one of the biggest twists in movie history.
Here's the deal: Malcolm comes home and starts talking to his wife while she's sleeping. He's doing this at Cole's suggestion, since he hasn't had much luck attracting her attention while she's awake. (Cole knows that people have better luck hearing ghosts when they sleep, we guess.)
While chatting with Anna, a wedding ring slips from Anna's hand, and Malcolm realizes it's his. Wait, why isn't he wearing his wedding ring? Suddenly, he thinks back to Cole's big speech about dead people who don't even know they're dead and he realizes the truth: he's dead. He's been dead since Vincent shot him.
It's pretty sad and super dramatic, and ghost Malcolm briefly starts bleeding again from his midsection. Once he's re-lived the whole horrible ordeal, though, he seems ready to say goodbye to Anna, telling her that she never came second to his work (in case she was wondering) and departing for whatever the rest of the afterlife looks like. We now realize, after having our minds temporarily blown, that Malcolm is one of those ghosts that can't leave until he works through his own issues.
What is particularly awesome about this ending is that it makes you think, "Wait. What? Malcolm was dead? He was interacting with his wife, and there was Cole's mom and Sean…" Then you have to go back and re-watch it to see that, nope, nobody but Cole actually spoke to him. Shmoop personally has never met anyone who picked up on the subtle clues throughout the film; we were all totally taken in by Shyamalan's misdirection magic. So don't feel bad if you were, too.
The American Psychological Association was probably also happy to learn that psychologists can be effective even after they depart this earth.
Let's see other doctors try that.