What's Up With the Ending?
Um, everyone dies.
Okay, okay—so maybe some people do survive. But none of the movie's three main leads (Costello, Billy, and Colin) make it to the credits. For many people, the ending of this movie is super unexpected, possibly even weak. A lot of people get really angry at how casually and suddenly Billy Costigan dies. And it's kind of strange how Colin makes it through the movie's big shootout only to get murdered in his apartment by Sergeant Dignam in the end.
What the ending of this movie seems to tell us is that the world of crime is crazy and unpredictable. In a real-world setting, we know that people can die at any time. Violence happens to good people as well as bad, and we should feel outraged at its randomness. But we always tend to feel underwhelmed when this same logic is applied to a movie. In a movie, we generally want good guys to win and bad guys to lose. But in this movie, it's fairly safe to say that everyone loses.
P.S. Did you notice Scorsese's reference to the end of The Third Man in the funeral scene at the end. Take a look: here's the shot of Vera Farmiga in The Departed, and then here's the final shot of The Third Man, which it's referencing. Scorsese, you sly dog.