Batman appeared out of nowhere in Gotham city after leaving the desert, how did he get back to the city? Also the fact that Bruce Wayne had to spend days hiding around one of Gotham’s destroyed bridge to paint a batman symbol with gasoline. He probably needed a few gallons – which mean he had to climb up and down a few times to finish his masterpiece while avoiding both Bane’s mercenaries and the police, how is this possible?
According to this answer:
The Pit is in Morocco.
In Batman Begins, Bruce traveled the world with no money and passport to understand crime. He ends up in a Bhutan jail, in which Ra's takes him to The League of Shadows Tibetan headquarters. Ra's teaches him to be "invisible", walk on ice, etc.
The first movie also mentions the secret "Underground Railroad " tunnels in the Bat cave which can connect to Gotham city. The League was unaware of the Bat cave and perhaps the tunnels. (Wayne Manor is outside Gotham)
So, here you go. Bruce has experience traveling around the world with no resources (he probably established ones in his previous journey), hence he could easily got back to the US. It's plausible he also got into Gotham through "invisibility" or the Bat cave.
As we can theorise that he is back in his bat cave, this means that he would had the resources available to carry out the feat of painting the gasoline "masterpiece".
When he was in the league of shadows he was taught all sorts of maneuvers, such as Ra's Al Ghul demonstrating he has to blend in and use your environment. We can assume he used these skills to be a master of deception and do what was needed under the noses of Bane's mercenaries. This is shown in the centre where one of the members is seen hanging from the roof almost invisible.
However this is a well known plot hole, there is many speculations on how Batman accomplished this. However this is the one I have come up with and believe to be most accurate after studying many different explanations and the film over and over.