At the end of The Dark Knight Rises we see Jim Gordon run his hand across a new bat signal, but as far as he knows Batman is dead and no more. So what was the purpose in building a new bat signal? Whilst it was implied that Robin would become Batman, there was no way for Gordon to know this, so it makes no sense to build the signal.
Sorry, no way to answer without spoilers:)
This entire section of the film is Bruce/Batman letting those that were closest to him know that he is still alive. You can tell by quite a few cinematic clues that this the case. The music is swelling after the downbeat funeral and will reading scene, it is cut into the other three "proof of life" scenes, and most importantly, it occurs after the "escape clause" scene, where we learn that the autopilot worked after all. When you examine the actual mechanics of the scene, it becomes even more clear. Jim Gordon is reading reports, double takes at seeing the signal repaired, approaches and lays his hand on the symbol to verify that it is real, and then glances all around as though looking for his friend whom he thought was dead.
The entire section is a callback to Begins, where Nolan did the exact same style of reveal when he was showing that Bruce had survived the events of that movie.
As for why? Bruce was sowing the seeds for Robin John Blake to take up his mantle and become the new defender of Gotham.
While I agree with Dylan Yaga's answer, he left out one major point that I feel should be addressed: Jim Gordon never rebuilt the Bat Signal. He did assume Bruce Wayne died.
Gordon was atop MCU looking over case files, as was his habit, and he saw the new Bat Signal after casually glancing towards it. The look on his face as he examines what he thought was a destroyed Bat Signal is surprise.
Bruce Wayne rebuilt the Bat Signal when he returned from The Pit, before revealing himself. We are not told how long he is in Gotham beforehand, which allowed him to set up leaving the bookbag that allowed John "Robin" Blake to access the Batcave, and time to rebuild the Bat Signal. He was letting Gordon know that Batman would return to protect the city.
The film's official movie novelisation is pretty clear on the sequence of events. In short, Wayne arranged for Blake to take over as Batman (by giving him directions to the Batcave) and for Jim Gordon to be made aware that someone had taken the place of the original Batman (by installing a new bat-signal).
Gordon banged the files against the air duct to straighten them. His gaze drifted across the familiar rooftop, then came to an abrupt stop. His jaw dropped, and he forgot all about the arrest reports. The shattered searchlight had been repaired. A brand-new bat-symbol, freshly cast in gleaming steel, was mounted atop an unbroken glass lens.
Stepping over to it—hesitantly, as if afraid it might vanish—he ran his fingers reverently along the outline of the emblem. Then he stared up at the night sky, looking for a sign. Perhaps he wasn’t on his own after all.
Blake left the daylight behind. Descending into stygian blackness, he pulled a flare out of the bag, and then lit it. A bright red flame sparked to life deep inside the cave. The sudden glare awoke a rustling, chittering mass high above his head. He ducked in alarm as thousands of screeching creatures swooped down from their roosts, flying wildly throughout the cavern. Leathery wings flapped all around him, buffeting him, engulfing him in a flurry of…bats.
The movie script concurs with this version of events. Gordon was unaware of the repaired Bat-signal until he stumbled across it..
EXT. MCU – NIGHT 318
Gordon bangs his files against the air duct, straightening them. He stops. Sees something. The searchlight … fixed. Gordon runs his fingers across a brand new, steel Bat symbol … He looks up into the night …
A good ending and a sign of hope. Gordon is happy to see the rebuilt signal and looks to see if his friend is nearby as Batman would alway surprise him. Gordon is hopeful again...but wasn't that alway Batmans objective...to give people hope.
Gordon didn't rebuild the bat signal. Bruce Wayne did.
It nicely parallels Bruce's other friends' discoveries, particularly what Bruce had left for Robin.
It seems fairly clear to me that this is the correct interpreation.
Even if Gordon had repaired the bat signal, it's not true that "it makes no sense".
Bruce: As a man, I'm flesh and blood, I can be ignored, I can be destroyed; but as a symbol...as a symbol I can be incorruptible, I can be everlasting.
This theme is repeated throughout all three movies. It's not about Batman being a hero, but the people of Gotham being inspired to become the heroes. The symbolism of the silent guardian of Gotham is more powerful than any man.
Gordon would have had very good reason to repair the signal, even if it hadn't been already done.