Following the events of TDK, Batman is targeted by Gotham City's police force as a dangerous vigilante and cop-killer. Due to the pressure from the police force, the mayor and the public, Commissioner Gordon has to reluctantly lead a task force but together with the sole purpose of locating, capturing and exposing Batman in order to put him on trial for his supposed crimes. Obviously, Gordon is doing everything he can to obstruct this investigation but cannot be seen to be doing so and must covertly sabotage the efforts made by the task force that he himself is leading.
In the meantime, Bruce is struggling with the burden that he has taken upon himself by posing as the common enemy of all the parties mentioned earlier in order to unite them and keep hope alive that one day Gotham can be free of corruption. On top of this, he is still reeling from Rachel's death and the seemingly unlikely possibility that he will ever be able to give up the persona of Batman, even if he does survive the public's witch hunt.
Oddly, despite the Batman's diminished presence on the streets due to the obstacles presented to him, crime in Gotham has taken a huge plunge, largely due to the example made by the Joker/Dent situation. The criminal underworld have been shown that they no longer own Gotham and any attempt to regain control will most likely end in their downfall leaving them to either relocate or throw in the towel all together. Simultaneously, the public have been shown by Dent and the failure of the Joker's ploy to bully the boats into executing each other that together they are strong and can stand against the atrocities they had come to accept as inevitable.
However, Batman is suspicious of the ever decreasing rate of crime. He is convinced that this is the calm before a devastating storm, particularly as he has been keeping tabs on predominant villains, some of which seem to have disappeared altogether rather than relocated. One lead takes him to the Louisiana swamps where he encounters Killer Croc. After a very difficult battle, Batman beats Croc into submission and forces some information from him. Croc reveals that Batman is right to be suspicious and takes enjoyment in telling him that his time is up. He reminds Batman how vulnerable he is, particularly now that his only (known) ally has been forced to work against him.
Back in Gotham, Gordon's previous relationship with Batman is being scrutinised and his ability to objectively run the task force charged with finding Batman is called into question. As a result, the Mayor demands that an outside specialist be employed to capture the Batman. This comes in the form of a highly skilled private detective retained by the government renowned for his innovative techniques and application of lateral thinking called Edward Nigma. His plan is to tempt the Batman into a trap using cryptic messages that will lead him to a location in which he can be caught. Gotham's police are unconvinced and mockingly name him "The Riddler".
Nigma sets up his trap and the Batman takes the bait. However, Nigma is an arrogant character and has a compulsion to include the opportunity for these riddles to be solved in such a way that the true motives behind them can be deciphered. Due to Bruce Wayne’s superior intellect, Batman discovers that this is indeed a trap just in time, the element of surprise is lost and Batman manages to escape (most likely by the skin of his teeth).
The fact that Batman solved the puzzle left by the Riddler infuriates him but Nigma insists on including an opportunity to solve his riddles correctly as he believes that he has not truly bested Batman without it giving him the chance to discover their true nature.
At this point, the plot thickens. Having failed to capture the Batman, Nigma visits the Iceberg Lounge to meet someone. It becomes clear that Nigma is in fact employed by part of the criminal underworld to infiltrate the task force and lead Batman into a trap where he will in fact be killed rather than captured, all under the guise of the actions of the Gotham City police.
Nigma is lead into a VIP back room by Oswald Cobblepott (portrayed in this as an arms dealer, short and fat but nor deformed like in the Burton version) and, after a brief conversation between the two, just to explore Oswlad for a bit as he won’t appear much more, the pair select masks (maybe even Oswald's looks like a penguin even though he is not referred to by this name) put them on and enter the room.
The mastermind behind the operation is revealed to be the Black Mask who has successfully rallied the predominant members of the criminal underworld into working towards the greater "good" of eliminating Batman.
The Batman visits Arkham to seek council from the Joker (not truly recast but sitting in the dark with only the occasional glimmer of his make-up and scars). He talks gruffly and explains that he has recently been choked by an inmate which ended in the Joker savagely killing him, hence the fact that he is now in pitch black solitary. Batman believes that the Joker is still receiving information from the outside about the criminal world (likely through Dr. Harley Quinn who would have been seen just previously to this scene) and wants to pick his brain as his doctrine of chaos might aide Batman in solving the recent puzzle set to him by Nigma. The Joker does assist but in the usual facetious and derogatory way.
The riddles are solved, Nigma is exposed as a double agent and the ultimate climax between Batman and the Black Mask takes place. (This part is brief purely because I don't really have any good ideas for a conclusion yet). Batman is heralded as a hero once more.
Batman returns to Arkham where he visits the Joker once more in the dark. This time he is uncharacteristically quiet, only making the occasional comment. Finally he gives himself away and Batman throttles him bringing him into the light where it is clear that this is an impostor and the Joker has escaped.
Final scene, Gordon has reinstated the Bat signal and called Batman to the roof. Gordon expresses that he is glad to signal the caped crusader again but Batman is less that pleased as he has come to the realisation that he will never stop being Batman, there will always be the need for him. Gordon praises Batman on his commitment which comes as little consolation to him. They mention the Joker (simply referring to him as “he”) and the fact that it won’t be long until he resurfaces again. Gordon speaks with Batman about the evil in the world and the fact that evil will triumph if good men do nothing. At this point he has turned his back, he turns around and in typical fashion Batman is gone. Gordon strolls over to the Bat signal obviously contemplating the events of the last few years. He reaches out to switch the signal off and hesitates. He looks up at the signal in the clear sky as clouds loom towards it. He smiles, comforted by this and finally switches the light off.
Cut to credits.