In Arthur Miller's The Crucible, John Proctor is not a perfect man. He has has an adulterous affair with Abigail Williams. He is aware of the implications of his actions. He has fired her from his household and resists her efforts to lure him back into her bed.
I have a sense for heat, John, and yours has drawn me to my window, and I have seen you looking up, burning in your loneliness...You are no wintry man. I know you, John. I know you. She is weeping. I cannot sleep fordreamin'; I cannot dream but I wake and walk about the house as though I'd find you comin' through some door. She clutches him desperately.
Of course, pushing her away and calling her "Child" can bring nothing but anger and resentment from her. It can be no surprise that John's wife Elizabeth is accused of witchcraft, and that John is also ultimately accused, but John shows his integrity by ending his affair. He further demonstrates his morality by refusing to give in to Abigail's enticements again.
Later, from a sense of integrity, John defies the court for its failure to pursue justice—believing instead the ridiculous stories of the young girls who run amok, accusing every decent person in Salem's Puritan colony in 1692 of witchcraft, as the spirit moves them.
Before the court, John does not lie about his affair with Abigail (though Elizabeth has tried to shield him by lying about it herself).
John is honest, also, about his shortcomings. He sees little in himself to praise. His is humbled by his sin, and admires those who have lived better lives. He makes no excuses for his behavior. He says:
I cannot mount the gibbet like a saint. It is a fraud. I am not that man...My honesty is broke, Elizabeth; I am no good man. Nothing's spoiled by giving them this lie that were not rotten long before...Let them that never lied die now to keep their souls. It is pretense for me, a vanity that will not blind God nor keep my children out of the wind...
At one point, John is ready to lie to save his life. He writes out his confession and signs it, much to Hathorne and Parris' joy—they believe that John is guilty of witchcraft; in admitting to it, John will save himself from the gallows. When they ask for the written confession, John refuses, stating that his spoken confession should be enough—but that he does not want to lose the integrity of his name, which has always been admirable. Hathorne also wants John to lie about others. We see John's integrity again in that he will not implicate his friends by lying about them:
I have three children—how may I teach them to walk like men in the world, and I sold my friends?
Despite his confession, at the last minute, he cannot—will not lie—not even to save his life. He tears up the confession. He tells those judging him:
You have cast your magic now, for now I do think I see some shred of goodness in John Proctor.
A man of integrity and honesty leaves to face his death.