John Proctor is tempted to sign a false confession to save his life in the fourth act. He goes so far as to verbally confess to witchcraft to Danforth and Parris. However, when the time comes to sign the written confession, Proctor stops short.
His reasons for confessing are clear. He wants to live and raise his children. His wife has been sentenced to death, and after she gives birth Elizabeth is set of be executed. If Proctor confesses to witchcraft, he can live and his children will have at least one parent.
Signing a false confession proves to be too much of a sacrifice and will rob him of the most valuable possession he might pass on to his children - his honor. By confessing, not only would Proctor destroy his own honor, he would also be condemning the others who are accused with him. He is unwilling to act in such an ignoble way.
Proctor's final recantation of his confession and his refusal to put his principles aside to save his life, we see the triumph of personal integrity in a world of moral uncertainty.
You may have to rephrase your question... John Proctor hangs at the end of Act IV. His wife refuses to "take his goodness" from him. He has admitted his guilt in having an affair with Abigail; he knows his reputation in Salem has been tarnished, but his wife loves him and, yes, he initially agrees to sign a confession in which he lies about seeing the Devil (and the other young women who were supposedly with him). The confession will save his life, a life which Elizabeth says she wants to live with her husband. But when the time comes, John knows that signing the confession will mean that his name is blackened in the town and that he will forever be known as a man who had dealings with the Devil. He also thinks of those who have died for the cause -- they won't lie to save themselves, and in the end, neither will he.
He refuses to sign the confession; he feels that his name is all he has left. He has given everything he had to the authorities. He has lost his wife to a false arrest, his manhood to the affair, and the respect of the townspeople who cannot seem to see through the lies of Abigail and her group of followers. You cannot forget about the strict Puritan background in Salem -- John's affair alone is enough to ruin any semblance of peace for him, but now that the situation has escalated to such an incredible degree, Proctor has no choice but to hang. He thinks of his friend, Giles Corey, who chose to die a terrible death (rocks being placed on his chest until he was crushed to death) rather than confess to a lie. Proctor ultimately feels that Giles' death, like his own, cannot be in vain.
My answer is predominantly based on the dialouge at the end of Act IV, in which John Proctor cries out: "Because it is my name! Because I cannot have another in my life! Because I lie and signmyself to lies! Because I am not worth the dust on the feet them that hang! How may I live withoutmy name? I have given you my soul; Leave me my name!"