John Proctor speaks his mind and he speaks directly. When Hale or anyone questions his integrity, he stands up for himself passionately almost to the point of sounding too defensive. Proctor does have an affair with Abigail, but he feels guilty for it and tries to make amends with Elizabeth. It is clear that the both of them intend to reconcile Proctor's misjudgment and move on in their marriage. When Proctor continues to shun Abigail, who may simply have been looking for companionship, she harbors extreme resentment. Caught in the forest, allegedly involved in black magic of some kind, Abby uses this as an opportunity to get her revenge on Elizabeth and John.
As many are accused, John and Elizabeth are as well. In the end, Proctor is honest. He admits in court that he had an affair with Abby. And near the end of the play, Proctor signs the confession that he consorted with the Devil. But he eventually tears the confession up because he wants to keep his integrity. Tearing up the confession, he also allies himself with others who also have refused to confess. Had he confessed to save his life, those who refused to confess would look more guilty to the court. This is why he says, "I have three children--how may I teach them to walk like men in the world, and I sold my friends?" (Act IV). So, in the end, he tries to set a good example and tries to protect others, at the expense of his own life.