The full plot of Saw 5 reveals that Hoffman is the man carrying on Jigsaw's work, and that he escapes the film with Agent Strahm taking the blame.
Seth, the convicted killer, dies in the pendulum trap at the start, and Hoffman is praised for closing the case. Strahm distrusts that conclusion. He goes through the evidence, becomes convinced that Hoffman was involved, and starts digging into Hoffman's past.
The five strangers, Ashley, Brit, Charles, Luba and Mallick, are forced through a run of rooms that punish selfishness. The rooms are built so that anyone who tries to save only themselves is hurt, and several of the group die in the early ones. The survivors only get further when they cooperate, which is the lesson the film keeps returning to.
Flashbacks fill in Hoffman's side. They show that John Kramer, the original Jigsaw (see John Kramer in Saw), forced Hoffman to take part in the games after Kramer learned that Hoffman had killed Seth. In other words, Hoffman did not volunteer. He was recruited under pressure.
In the last room, the two survivors, Brit and Mallick, learn that the whole group shared a link to a deadly fire. They have to work together to supply the blood needed to open the final door, and Mallick dies in the process.
Meanwhile, Hoffman plants evidence that frames Strahm as Jigsaw's successor. Strahm tracks Hoffman down and locks him in a glass box, but Strahm is then caught in a room with closing walls. Hoffman watches from the box as Strahm is crushed, and Hoffman is left as the keeper of Jigsaw's legacy. The Saw timeline places this film directly after Saw IV in story order.