Late at night on a deserted road, well-known actor Armaan Kapoor (Vivan Bhatena) loses control of his car for no evident reason, apparently trying to avoid something, and drives into the river. Inspector Surjan Shekhawat (Aamir Khan) with his assistant Devrath Kulkarni (Rajkummar Rao) begins an investigation into Armaan's death. Surjan's personal life is in turmoil since his 8-year-old son, Karan, drowned recently during a family outing. His wife, Roshni (Rani Mukerji), is still grieving and Surjan has developed a guilt complex.
Surjan learns that on the night of Armaan's accident, Armaan was travelling with 2 million rupees in cash, which is missing from the car. Armaan had given the money to a blackmailer, a pimp named Sashi (Subrat Dutta). Three years back, Sashi had performed a cover-up for Armaan and his friend Sanjay Kejriwal (Suhas Ahuja).
Once he learns of Armaan's death, Sashi takes off with the cash, leaving behind a mistress, Mallika (Aditi Vasudev). Sashi's friend, Tehmur (Nawazuddin Siddiqui), steals Sashi's discarded sim card. Sashi begins blackmailing Sanjay. In panic, Sanjay employs some thugs to murder Sashi. Tehmur begins to use Sashi's old sim card to blackmail Sanjay with Sashi's murder.
Meanwhile, Roshni seeks solace from a medium (Shernaz Patel) who is in touch with Karan's soul. One night, Surjan is propositioned by an escort, Rosie (Kareena Kapoor). He declines Rosie's advances but asks her if she can become an informer. Through Rosie, Surjan finds out about Sashi's connection with the case. The police find Sashi's body, along with the blackmail money and a DVD.
The DVD contains embarrassing CCTV footage of Armaan and his friends leaving a hotel with a girl. Convinced of Armaan's link with prostitutes, Surjan focuses his search on the slums near the local leedo. To speak unobserved, Rosie takes Surjan to a quiet place by the riverside and tells him that three years ago, she was picked up by Armaan and his friends, Sanjay and Nikhil (Prashant Prakash). However, she doesn't reveal anything more. Surjan tries to approach Nikhil for more information but discovers that Nikhil has been brain-dead after the incident three years ago. After a heated argument with Roshni, Surjan confides in Rosie, who comforts him by taking him to leedo.
Tehmur is killed by the two thugs in Sanjay's employ. One of the thugs is captured by the police and reveals that Sanjay has been behind the murders of both Sashi and Tehmur. Surjan arrests Sanjay, who confesses that three years ago, Sanjay, Armaan and Nikhil had picked up an escort to celebrate Nikhil's birthday. While driving, Nikhil began making out with the girl in the backseat. The car door opened by accident, throwing both Nikhil and the girl from the moving car to the road.
Both were badly injured. Armaan and Sanjay rushed Nikhil to the hospital but fearing scandal, left the girl unattended on the road. Sanjay had called Sashi to ask him to take care of her. However, Sashi informed them that the girl had died and that he had footage of the three leaving with her. Since then, Sashi had continued to extort money from them by blackmail.
Surjan re-watches the footage and realizes that the girl is Rosie. As he drives Sanjay to the police station, they approach the same road where Armaan had his car accident. Both Surjan and Sanjay see Rosie standing ahead. In a re-enactment of Armaan's accident, Sanjay swerves the car into the river. With Sanjay already dead, Surjan struggles to get himself out of the car. Rosie appears underwater and saves him. At the police station, Surjan's superior advises him against reporting his incredible story.
Surjan agrees to write in the official report that Armaan Kapoor's death was an accident. He returns to the riverside place where he used to meet Rosie and uncovers her remains where Sashi had hidden her body. Remembering that he had been told that "the dead come to those who are troubled," he gives her a proper funeral.
Now more accepting of the supernatural, Surjan finds a letter from Karan, penned by the medium. Through the letter, Karan tells Surjan not to blame himself for his death and that he wants both his parents to be happy. Surjan cries and Roshni consoles him. The two are reconciled.