Only in Dreams
At the end of the movie, Travis has missed his chance to assassinate Charles Palantine and secure a place for himself as one of the great villains of American history. Instead, he puts his anger to arguably better use, going on a murder rampage and killing Sport and two other gangsters involved in controlling prostitution. It's really, really bloody—Travis shoots off fingers and stabs a guy through the hand before blowing his brains all over the wall. Wounded, Travis tries to kill himself, but has no bullets left.
Instead, he winds up in a coma, before waking up a hero. The newspapers, not to mention Iris' parents, view him as a heroic liberator of a child prostitute—which is the external truth and not the violent, inner truth about his madness. He even gets to give Betsy a ride in his cab, before leaving her behind. In the last moments of the movie, we see Travis' eyes flash in his rear view mirror, accompanied by a strange noise.
Did this heroic reception really happen? Is it just Travis' fantasy? That's what some people claim, considering that it seems unrealistic that he wouldn't face some sort of criminal penalty for a triple murder (even if the three guys involved were pretty bad). These critics imagine Travis went crazy or had some sort of dying dream about what he would've liked to happen.
The Real Thing
However, that's not what the filmmakers themselves thought about the ending. Scorsese and Schrader intended the audience to believe that Travis really was greeted as a hero, with the city's madness and desire for vengeance against bad guys like Sport equaling or exceeding Travis' own madness. Schrader said it's not a dream sequence, but it ends where it began, with Travis driving around the city and fueling his hate, waiting to let it build up and explode again.
When Taxi Driver aired on TV, the filmmakers added an unexplained disclaimer to the broadcast:
To our Television Audience:
In the aftermath of violence, the distinction between hero and villain is sometimes a matter of interpretation or misinterpretation of facts. Taxi Driver suggests that tragic errors can be made.
This seems to buffer the idea that society misunderstood Travis' actions and couldn't see the troubled person behind them.
Critics have felt similarly. James Berardinelli points out that, if it isn't a dream sequence, it adds an important piece of irony to the movie: Travis would've been a villain if he'd shot Palantine, but is a hero because he ended up killing gangsters.
Roger Ebert says he's not sure we can say what happened at the end—whether it's fantasy or dream—but that it completes the movie on an "emotional level" and leads to a redemptive arc experienced by many Scorsese characters (if Travis really is redeemed).