In 2012, the economy of the United States collapses. Unemployment and crime rates skyrocket, and the sharp increase of convicted criminals leads to the privatization of prisons for profit. For pay-per-view entertainment, a modern gladiator game called “Death Race” is invented at the Terminal Island penitentiary using the prisoners as players. Drivers are paired with navigators to assist them with maintenance, weapons, and track guidance. There are three types of special pads on the track, shields, swords, and death heads, that a car can activate by running over with all four tires. Shields activate a car's defensive weapons, swords activate a car's offensive weapons, and death heads, when activated, extend a row of spikes out of the ground that impales a pursuing car, and then retracts back into the ground, crushing the car and finishing off any survivors. A single Death Race takes place over three days and is divided into three stages. The first two stages are elimination rounds, where drivers eliminate as much competition as they can without getting themselves killed. The remaining drivers then compete in the final stage, where the goal is to be the first to cross the finish line without getting killed. If a driver can survive and win five races, they're freed, although nobody has ever done so as they all end up dead eventually.
At the end of one race, a masked driver named Frankenstein (David Carradine) is nearing the finish line against his only surviving competitor, rival Machine Gun Joe (Tyrese Gibson). His navigator, Case (Natalie Martinez), reports that his defensive weapons are malfunctioning, and is ordered to eject from the car shortly before Joe blows it up. Six months later, Jensen Ames (Jason Statham) is sent to Terminal Island after being framed for his wife's murder. The warden, Hennessey (Joan Allen), informs Ames that – unknown to the public and other racers – Frankenstein is dead, but as he was so wildly popular, she wants to keep his legend alive for the ratings. She coerces Jensen to clandestinely assume the persona; Ames would only need to win one race to earn his freedom and take back his baby daughter since Frankenstein won four, and by wearing Frankenstein's mask, only few people will know he's not really Frankenstein. His maintenance crew, Coach (Ian McShane), Gunner (Jacob Vargas), and Lists (Frederick Koehler) are among those who know this and quickly acquaint Ames with his competition.
On the first day, Ames meets Case, who also knows he's not the real Frankenstein. Jensen has a rough first go, coming in last place, and three racers are eliminated. His defensive weapons also mysteriously malfunctioned, just like last time. Ames pieces together that one of the racers, Pachenko (Max Ryan), was the one who stabbed his wife at the behest of Hennessey so she could recruit him as Frank's replacement for huge profits. During the second stage, Ames forces Case to admit that she has been sabotaging Frankenstein's car on the orders of Hennessey in exchange for her release papers. Case was never meant to kill Frank or Ames, just stop them from winning so Frankenstein could remain in Death Race. Jensen then personally dispatches Pachenko by brutally breaking his neck, and temporarily teams up with Machine Gun Joe to destroy a massive 18 wheel tanker with many weapons that kills the other competitors to boost the ratings even higher. This tips Joe off to Frank's real identity, and afterward they have a talk.
Hennessey, aware that Ames knows her angle, tries to maintain the ruse of granting him freedom but asks him to consider staying on permanently as Frankenstein. As a precaution, she secretly has an explosive planted under his car before the start of the third round, knowing that she can replace Ames as she used him to replace Frankenstein. The stage begins, and Hennessey manipulates the track in Joe's favor from her control room. Right when Joe appears victorious, they both escape through a damaged wall previously discovered by examining footage of another racer's demise. Hennessey tries to activate the bomb, but the crew had found it and removed it prior to the race. Ames and Joe make it past the bridge, split up, and attack helicopters follow Ames. Case offers herself as bait in the Frankenstein costume and mask to repay the old Frank, and because she'd already been given her release papers. She is captured while the two men escape.
Later, Hennessey is given an anonymous gift in recognition of her record-breaking ratings. It turns out to be the bomb she originally meant for Jensen, with a note saying: "WARMEST REGARDS, YOU MONSTER!". At that moment, Coach remotely detonates the bomb, blowing up her office with her in it. Six months afterward, Joe, Ames, and his baby girl are shown living honestly in Mexico, where Case joins them, and Ames reflects on how no one could love his daughter more then he does.
Casey Beldon has nightmarish hallucinations of strange-looking dogs and an evil child with bright blue eyes. While babysitting Matty, her neighbor's son, she finds him showing his infant sibling its reflection in a mirror. Matty attacks Casey with the mirror and tells her, "Jumby wants to be born now."
Casey's friend Romy tells her of a superstition that newborns should not see their reflections for at least a year because otherwise they will die soon. Casey's eyes begin to change color; a doctor asks if she is a twin, and explains the change as tetragametic chimerism and heterochromia. Her neighbor's infant dies, supporting the superstition.
Casey's father admits that she had a twin brother who died in the womb when her umbilical cord strangled him, and whom he and Casey's mother had nicknamed "Jumby". She begins to suspect that the spirit haunting her is the soul of her dead twin wanting to be born so it can enter the world of the living. Casey meets Sofi Kozma—whom she later learns is her grandmother—who explains that as a child she had a twin brother who died during Nazi experiments in Auschwitz during World War II. A dybbuk brought the brother back to life to use as a portal into the world of the living. Kozma killed her twin to stop the spirit, and now it haunts her family for revenge, which is why Casey's mother became insane and committed suicide. Kozma gives Casey a hamsa amulet for protection; instructs her to destroy all mirrors and burn the shards; and refers her to Rabbi Joseph Sendak, who can perform a Jewish exorcism to remove the dybbuk. Sendak does not believe Casey's story until he sees a dog with its head twisted upside down in his synagogue. The dybbuk kills Kozma and, soon after, Romy. Casey and her boyfriend Mark—who both see the spirit after it kills Romy—realize that it is getting stronger.
Sendak, Mark, Episcopal priest Arthur Wyndham, and other volunteers begin the exorcism, but the dybbuk attacks them and several are wounded or killed. The spirit, having possessed the priest, chases Casey and Mark. Mark knocks Wyndham unconscious but gets possessed. Casey stabs Mark in the neck with the amulet; Sendak arrives and he and Casey complete the exorcism. The rite draws the dybbuk out of the human world, but Mark falls and dies during the separation.
Casey mourns her boyfriend but wonders why the dybbuk became active in her life now. She learns that she is pregnant by Mark, with twins.
Adam Stanheight (Leigh Whannell), a photographer, and Dr. Lawrence Gordon (Cary Elwes), an oncologist, awaken at opposite ends of a disused bathroom, Adam in a water-filled bathtub. Both men are chained at the ankle to the pipes. Lying between them is a corpse in a small pool of blood holding a revolver and a microcassette recorder. Adam and Lawrence discover tapes in their pockets; the men learn from both tapes that Adam must escape the bathroom, while Lawrence must kill Adam before six o'clock, or he'll lose his wife and daughter and be left to die. They find a bag containing two hacksaws, though neither is able to cut through the chains. Adam breaks his saw and throws it at a mirror in frustration; Lawrence realizes that the saws are meant to be used on their feet. Lawrence tells Adam that their captor is the Jigsaw Killer, who places his victims in situations or traps, referred to as "games", in which they must be put through physical and/or psychological torture to survive and escape with a better appreciation for life. Flashbacks show that while Lawrence was talking with some students and an orderly named Zep Hindle (Michael Emerson) about the terminal brain cancer of a man named John Kramer (Tobin Bell), he was approached by Detectives David Tapp (Danny Glover) and Steven Sing (Ken Leung) about his penlight being found at the scene of a Jigsaw "game". He viewed the testimony of Amanda Young (Shawnee Smith), a heroin addict, who is the only known survivor of Jigsaw's games; she barely escaped from having her jaw ripped open during her game by a "Reverse Beartrap" and believes that her experience made her a better person. Other victims of Jigsaw's games included Paul (Mike Butters), who was trapped in a cage filled with razor wire, and Mark (Paul Gutrecht), who was trapped in a room with a flammable substance all over his body along with a candle to help him read the walls covered with numbers that hid the combination to a safe. One of the detectives revealed that Jigsaw frequently watched his victims die — he "liked to book himself front row seats to his own sick little games". Meanwhile, Lawrence's wife and daughter, Alison (Monica Potter) and Diana (Makenzie Vega), are being held captive in their home by a man who is watching Adam and Lawrence through a camera behind the bathroom's mirror while tormenting Alison and Diana. Their house is simultaneously being watched by Tapp, who was discharged from the force. Flashbacks show that he became obsessed with the Jigsaw case after viewing Amanda's testimony, and that he and Sing illegally entered a warehouse they knew to be Jigsaw's lair and saved a man from being killed by drills aimed at his neck. Jigsaw managed to make a run for it after slashing Tapp's throat, and Sing was killed by a shotgun booby trap while pursuing him. After being discharged, Tapp began stalking Lawrence. In the bathroom, Lawrence finds a cigarette, a lighter, and a mobile phone that can receive calls but not send them. He and Adam use the first two items to try to stage Adam's death, but an electric shock through Adam's ankle chain foils this plan. Following these events, Adam and Lawrence recall their abductions; they were both ambushed and knocked unconscious by a stranger wearing a gruesome pig mask. Lawrence receives a call from Alison, who warns him that Adam knows more than he is telling. Adam explains that he was paid to take pictures of Lawrence for the past few days by Tapp, and shows Lawrence a pile of pictures of him from the bag containing the hacksaws. Lawrence berates Adam for invading his privacy, while Adam shows Lawrence evidence that he was cheating on Alison. Adam then notices a picture of a man in Lawrence's house; Lawrence identifies the man as Zep Hindle, and the two deduce that Zep is their abductor. Adam then points out that it is six o'clock, the deadline. Zep moves to kill Alison, but she frees herself and manages to overpower Zep, gaining Tapp's attention in the process. He arrives in time to save Alison and Diana from Zep, allowing them to escape, and chases Zep to the sewers. Lawrence, who is only aware of gunshots and screaming, is zapped by the ankle chain as well and loses reach of the phone; in desperation, he saws off his foot and shoots Adam with the corpse's revolver. Zep, who shot Tapp during the chase, enters the bathroom intent on killing Lawrence, only to be blindsided by Adam (whose shoulder wound had not been fatal) and beaten to death with a toilet tank cover. As Lawrence crawls away with the promise that he'll return with help, Adam searches Zep's body for a key and finds another microcassette recorder. He learns that Zep was another victim of the game, following rules to obtain an antidote for the slow poison within his body. In the film's iconic ending, the corpse in the middle of the room rises to its feet and reveals itself as John Kramer, the real Jigsaw Killer. He tells Adam that the chain's key is in the bathtub, which was drained when Adam accidentally kicked the plug out. Adam grabs Zep's pistol and tries to shoot Jigsaw but is electrically shocked by his hidden remote control before he can do so. Jigsaw then turns off the lights and seals the door to the bathroom, leaving Adam to die.