Part of what make The Crucible so powerful is its use of irony. Remember when looking for irony, you're looking for anything that is the opposite of what you expect.
In Act IV, Hale returns to Salem. He left in disgust at the end of Act III, but his conscience has brought him back. He tells Danforth
I have come to do the Devil's work. I have come to counsel Christians they should belie themselves.
Reverend Hale came to Salem with the belief that he was helping free the afflicted girls of withcraft; however, he has learned that it was his investigation which has actually lead these people to be condemed and many executed. Now he has returned to bring the characters "to God." But since these are already holy people (Martha Corey, Rebecca Nurse, and John Proctor) he is "bringing them to God" but getting them to lie and confess to sins they did not commit.
Proctor's confession is ironic. He is able to rationalize to himself and Elizabeth that he is not an innocent man. He has sinned before (Abigail) so what's wrong with confessing to this sin? He doesn't see himself as a holy man anymore, so he feels he should be able to lie and live. The irony occurs when he finds that he cannot lie and instead recants his confession.
The end of the play is ironic. Proctor finds peace with himself and his actions when he rips up his confession. Of course, ripping up the confession is a sign of guilt in the eyes of the court, so he will be sent to the gallows, but as Elizabeth tells Reverend Hale, he has regained his goodness and sense of who he is.
He have his goodness now. God forbid I should take it away from him!