At the end of the play, and the movie, Rebecca Nurse is a martyr, she is executed for witchcraft. She was accused by Anne Putnam and did not confess, would not confess, therefore, she is hung.
Rebecca Nurse's death at the end of the play inspires John Proctor to maintain his dignity, integrity and withdraw his oral confession and refuse to sign a written confession that was to be used as a tool to prove that there were witches in Salem.
John Proctor is inspired by Rebecca Nurse's sacrifice, she would rather die an innocent woman than confess to being a witch to save her life. She refuses to surrender her soul to the evil that has gripped Salem. Rebecca Nurse's death is a true tragedy, a woman who is considered to be an example of a truly devoted Puritan, a model Christian.
John Proctor dies with peace in his heart knowing that he did not cooperate with evil, the court, and that he saved his name for his family. He protected them from the scandal that would have ensued if he had gone through with the confession. The only way that he can save his family from this shame is to follow Rebecca Nurse's lead and die a martyr's death.