John starts off as a deeply troubled man who is trying to do what is right, but is still defiant and proud about many things. He has cut off his affair with Abby, confessed it to his wife, but isn't quite sure it was for the best. He tells Elizabeth, "I should have roared you down when you first told me your suspicion. But I wilted, and,...I confessed." Here you see him wondering what would have happened if he had not confessed. He is also openly contentious with Parris and Putnam, and many others.
He starts to truly change when Elizabeth is arrested; he swears to her that he "will bring [her] home" and is willing to let Mary Warren "tell the court what [she] know[s]" of the girls pretending, and even of his affair if necessary.
At the courts, Proctor finally breaks down all pride and defensiveness, admitting his affair and saying, "I set myself entirely in your hands." His sin has humbled him, and his desire to help Elizabeth has made him willing to submit, even to a cruel judge.
At the end he is no longer an angry, resentful man. He has come around, and is willing to give his life. He finally feels that "I see some shred of goodness in John Proctor," and goes to the gallows with a clean conscience, at peace. His journey to that "goodness" was a tumultuous one, where he had to let go of his anger, pride and defensiveness. But when he does, he "has his goodness" and can die with a clean heart.