Proctor decides to confess after he talks with Elizabeth.They haven't seen each other for a long time, and for the first time in a long time, John and Elizabeth are being honest with each other and themselves. John realizes that by living, he will have an opportunity to start over in his marriage and to raise his children. Elizabeth admits to John that not only does she forgive him for his affair, but she also admits that she's partly responsible for it. Both John and Elizabeth have much to live for and look forward to. They know what's important, and this makes John want to live.
The reason that John Proctor decides to confess in Act IV is that he does not want his wife and their child (Elizabeth is pregnant) to be left without a husband and father. Because of this, he will confess so as to save his life. He also does not want to die for no good reason -- he does not think that dying will actually do any good. Because of this, he feels that it is better to live.
Of course, he then changes his mind after seeing Goody Nurse and how she is taking it. He decides that he would rather listen to his own conscience -- he would rather die honestly than live as a liar.
After John Proctor met Elizabeth, he asked about his friends and the people convicted in the sham trials. John discovered that his friend Giles Corey was crushed to death after he failed to take a plea. He also learned that many of the other prisoners had decided to confess to the charges. However, he also learned that Rebecca Nurse had rejected any attempts to get her to confess.
John also asked after his sons and the child he was expecting, because Elizabeth was pregnant at the time. John was willing to confess because of what he was bound to miss out on if he died. He was worried about his family and how they would survive without him. The baby on the way meant greater responsibility for Elizabeth and for these reasons Proctor was willing to make the false confession.