Skyrim:A Cornered Rat

Quick Walkthrough
# Speak to Delphine in Riverwood.
# Talk to Brynjolf in Riften or talk to the Argonian bartender in The Bee and Barb.
# Search the Ratway for Esbern's hideout.
# Find Esbern in the Ratway Warrens.
# Talk to Esbern.
# Bring Esbern back to Delphine at Sleeping Giant Inn in Riverwood.

Detailed Walkthrough
Finding the Rat
After infiltrating the Thalmor Embassy, return to Riverwood and inform Delphine of what you learned from the Thalmor records. Delphine is surprised to know her old colleague and fellow Blade, Esbern, is reportedly still alive. She tasks you with finding the archivist from his hiding place in Riften. Due to the clandestine nature of the Blades, Delphine gives you a secret phrase to deliver to Esbern in order to secure his trust when you locate him.
Depending on your standing with the Thieves Guild, the journal will direct you to talk to Brynjolf, or search the Ratway for Esbern.
If you are directed to find Brynjolf, you may speak to him, Dirge, or Vekel the Man inside The Ragged Flagon. All three give an option to persuade or bribe them for information on Esbern's location.

Brynjolf

Vekel the Man

Dirge

If you have already joined the Thieves Guild, the Ratway is accessible and you can locate Esbern directly. Speaking with Keerava, the Riften innkeeper, also advances the quest. 

The Ratway
The Ratway and the Ratway Vaults beneath Riften are inhabited by a number of lowlifes, vagrants, and three or four Thalmor warriors searching for Esbern. When you reach the door to Esbern's room in the Ratway Warrens, he is very wary of Thalmor agents and initially refuses you entry. You may persuade him by saying Delphine sent you, you can tell him the password Delphine gave you: "Where were you on the 30th of Frostfall?", or you may explain that you are the Dragonborn.
The Dragon's Return
Once Esbern lets you in, he has some dire predictions about the state of the world: Alduin the World-Eater's return has apocalyptic implications, and Esbern's warnings of this threat have been consistently ignored. Esbern makes it clear that there had been no hope until you arrived and that he had believed the world was going to end. He agrees to follow you to Delphine's base in Riverwood.

Before leaving, however, Esbern will scamper about his room, claiming that he has to remove any sensitive information the Thalmor may discover. He will also gather some supplies from the chest at the foot of his bed and then will be ready to leave. The quest ends here and the next quest, Alduin's Wall begins.

Notes
If any follower is hired prior or during the quest, they will not be forced to return to their original location when Esbern comes along, making him a second follower.
If he survives Diplomatic Immunity, Gissur will be seated at a table in the Ragged Flagon when you get Esbern's whereabouts from Vekel the Man. After you end conversation with Vekel, Gissur will get up from the table and leave the Flagon. If you are a member of the Thieves Guild, Vekel will suddenly say "That one, right there, walking out the door! He was one of them asking about that old man you were looking for." If confronted, Gissur will only rebuff your attempts at conversation, but the note he carries reveals his true intentions. He can be attacked and killed with no repercussions, and other Thieves Guild members will join the fight on your side if you are a guild member, which may make your escape with Esbern easier. If you choose to follow Gissur to his assigned contact instead of killing him, he will head into the Ratway. He meets up with two Thalmor soldiers and a Thalmor wizard and informs them about you:

::Gissur: ''"He's/She's in the Flagon right now. Get ready."
::Thalmor Wizard: "You're sure?"
::Gissur: "Of course I'm sure! He/She was asking about Esbern."
::Thalmor Wizard: "Doesn't matter. We'll kill them either way."''

:At this point they'll all make their way back to the Flagon and accost Vekel (or Dirge, if Vekel's dead), demanding to know where you are:

::Thalmor Wizard: "Where is he? The one who was asking about the fugitive hiding in the Ratway?"
::Vekel: ''"You're in the wrong place to be asking those kind of questions, pal."
::(The Thalmor soldiers draw their weapons.)
::Thalmor Wizard: "No. Not yet."
::(The Thalmor soldiers sheathe their weapons.)
::Vekel: "You'd better clear out before someone gets hurt."
::Thalmor Wizard: "Your lack of cooperation has been noted. We'll be back if we require further information. You won't get a second chance."
::Vekel: "The answer ain't gonna be any different the next time. Arrogant elven bastard."''

:The Thalmor will then leave the Ragged Flagon and go back into the Ratway to wait for you, while Gissur will return to his seat in the Flagon. They will be hostile on sight, so you will only hear the above conversations if you remain hidden throughout.
If A Chance Arrangement has been started, Brynjolf cannot be talked to.
It is possible to proceed directly to Esbern without returning to Delphine first. Esbern will unlock his door if you tell him you are Dragonborn.

Bugs
 
 You may have to skip forward to the start of the next quest, Alduin's Wall, by using the console and typing in  , which will allow you to continue.
 Use console command   to force Esbern to open the door and talk again. Stage 160 makes Esbern open the door, if bugged. Stage 170 makes Esbern talk again, if bugged. Another easier way to avoid bugs is to type in  , which would work for any quest value.
 
 
 

Quest Stages