Walter Neff (Fred MacMurray), a successful insurance salesman, returns to his office building in downtown Los Angeles late one night. Visibly in pain, he begins dictating a confession into a Dictaphone for his friend and colleague, Barton Keyes (Edward G. Robinson), a brilliant claims adjuster. The story, told primarily in flashback, ensues.
Neff first meets the alluring Phyllis Dietrichson (Barbara Stanwyck) during a routine house call to remind her husband (Tom Powers) that his automobile insurance policy is up for renewal. They flirt, until Phyllis asks how she could take out an accident policy on her husband's life without his knowledge. Neff deduces she is contemplating murder, and makes it clear he wants no part of it.
However, he cannot get her out of his mind, and when Phyllis shows up at his own home, he cannot resist her any longer. Neff knows all the tricks of his trade and devises a plan to make the murder of her husband appear to be an accidental fall from a train that will trigger the "double indemnity" clause and pay out twice the policy's face value.
After Dietrichson breaks his leg, Phyllis drives him to the train station for his trip to Palo Alto for a college reunion. Neff is hiding in the backseat and kills Dietrichson when Phyllis turns onto a deserted side street. Then, Neff boards the train posing as Dietrichson and using his crutches. He makes his way to the last car, the observation car, and steps outside to the open platform to supposedly smoke a cigarette. A complication ensues when he meets a passenger named Jackson (Porter Hall) there, but he manages to get the man to leave. Neff then throws the crutches on the railway tracks, jumps off at a prearranged meeting spot with Phyllis, and drags Dietrichson's body onto the tracks by his crutches.
Mr. Norton, the company's chief, believes the death was suicide, but Keyes scoffs at the idea, quoting statistics indicating the improbability of suicide by jumping off a slow-moving train, to Neff's hidden delight. Keyes does not suspect foul play at first, but his instincts, to which he refers as the "little man", pointing to his stomach, starts nagging. He wonders why Dietrichson did not file a claim for his broken leg, and deduces he did not know about the policy. Keyes tells Neff of his theory outside Neff's apartment, while Phyllis hides behind the door. Keyes soon concludes that Phyllis and some unknown accomplice murdered Dietrichson for the insurance money, but needs more proof.
Keyes, however, is not Neff's only worry. The victim's daughter, Lola (Jean Heather), comes to him, convinced that stepmother Phyllis is behind her father's death. Lola's mother also died under suspicious circumstances, when Phyllis was her nurse. Neff begins seeing Lola, at first to keep her from going to the police with her suspicions and then because he is plagued by guilt and a sense of responsibility for her.
Keyes brings Jackson to Los Angeles. After examining photographs of Dietrichson, Jackson is sure the man he met was not that old, but at least 15 years younger. Keyes is eager to reject the claim and force Phyllis to sue. Neff warns Phyllis not to go to court and admits he has been talking to Lola about her past. Lola eventually tells him she has discovered her boyfriend, the hotheaded Nino Zachetti (Byron Barr), has been seeing Phyllis behind her (and Neff's) back.
When Keyes informs Neff that he suspects Nino of being Phyllis's accomplice (Nino has been spotted repeatedly visiting Phyllis at night), Neff sees a way out of his predicament. He arranges to meet Phyllis at her house. He informs her that he knows about her involvement with Nino, and guesses that she is planning to have the other man kill him. He tells her that he intends to kill her and put the blame on Nino. She is prepared, however, and shoots him in the shoulder. Seriously wounded but still standing, he slowly comes closer and dares her to shoot again. She does not, and he takes the gun from her. She says she never loved him "until a minute ago, when I couldn't fire that second shot." Neff doesn't believe a word she says, and as she hugs him tightly, Neff says, "Goodbye, baby," and shoots twice, killing her.
Outside, Neff waits for Nino to arrive (something Neff had orchestrated). Neff advises him not to enter the house and instead go to "the woman who truly loves you": Lola. Nino is reluctantly convinced and leaves as told. Neff drives to his office and starts speaking into his Dictaphone, as seen at the film's opening. Keyes arrives unnoticed and hears enough to know the truth. Keyes sadly tells him, "Walter, you're all washed up." Neff tells Keyes he is going to Mexico rather than face the gas chamber, but sags to the floor from his injury and blood loss before he can reach the elevator. A weakened Neff tells Keyes the reason he couldn't figure the case out was beacause the guy he was looking for was "too close, right across the desk from you." When Keyes replies "closer than that, Walter." Neff replies that he loves Keyes too. As Neff had done lighting Keyes' cigars for him throughout the film, Keyes lights Neff's cigarette as they await the police and an ambulance.

Question: Who poses as Dietrichson on the train?
Answer: Neff.