Mary Warren has always been understandably reluctant to support the Proctors with legal testimony. She is bound to be called a liar, since her story now is that she was lying and dissimulating earlier in the trials, and she does not stand up well under Danforth's initial interrogation. Her inability to pretend to faint when required to do so makes it very clear that her histrionic powers are vastly inferior to Abigail's.
When she is faced with Abigail's convincing pretense that Mary has sent her spirit out, there is no serious contest between the two of them. Abigail has Mercy Lewis, Susanna Walcott, and the other "children" backing her up, and they engage in a sadistic and deadly version of "the shadow game," repeating everything Mary says. This gives rise to hysteria—which affects even Danforth.
The pressure on Mary becomes intolerable at this point. Abigail and her accomplices—Danforth and Proctor as well as the whole weight of both sides in a deadly dispute—bear down upon her and she snaps. Mary is a weak character in any case, and she takes the line of least resistance, suddenly allying herself with Abigail and her other tormentors in order to make them stop. It is debatable how much of this is conscious treachery and how much is derangement at the psychological trauma she has experienced. In either case, however, it is the pressure Abigail exerts upon her that forces Mary to change her testimony.
Mary Warren changes her testimony and accuses John Proctor of witchcraft because she is afraid of Abigail Williams, whom Mary has indirectly accused of murder. When it seems clear that the magistrates are taking Mary's honest testimony seriously, Abigail begins to accuse her of witchcraft. Abigail talks to an invisible "yellow bird" as though it were Mary, suggesting that the bird has said that it "want[s] to tear [Abigail's] face." This testimony would have been admitted to the court as spectral evidence: the Puritans believed that a witch could send out her specter (or spirit) in its own shape or even in the shape of an animal to harm her victims. Since only the witch and her intended victim could see the specter, no one else could deny this evidence. As a result of Abigail's masterful acting, Danforth says to Mary,
A little while ago you were afflicted. Now it seems you afflict others; where did you find this power?
Danforth believes Abigail and not Mary. Meanwhile, the girls begin to mimic Mary's speech, John Proctor tells her that "God damns all liars!" and Danforth insists that she has "seen the Devil" and "made a compact with Lucifer." Mary cannot take the pressure, and she very likely fears for her own life. She knows what Abigail is capable of. Suddenly, she turns on John because this seems to be the only way to save herself. Her testimony against him will, of course, be believed (as all testimony that accuses others has been).
As was mentioned in the previous post, Mary Warren changes her testimony because she is afraid of being accused of witchcraft. Toward the end of Act III, Mary Warren admits to Deputy Governor Danforth that the girls were faking in court. When Danforth calls for Abigail Williams, she confronts Mary Warren face to face. Mary is a rather weak, timid individual who succumbs to peer pressure easily and cannot maintain her composure when Abigail begins to act like Mary's spirit is attacking her. Abigail pretends that Mary's spirit is threatening her, which makes Mary begin to panic. Mary begs Abigail to stop, but Abigail continues to pretend she is being attacked, and all of the other girls join in. Mary realizes the judges have faith in Abigail and will believe her, so Mary does what is best for herself and switches sides. Mary begins to accuse John Proctor because she fears that if she does not, she will be accused of witchcraft. Danforth will think Mary tried to overthrow his court and severely punish her. To avoid punishment, Mary capitulates to Abigail and begins to accuse John Proctor of working with the Devil.
Mary changes her story because she is afraid that she will be accused of witchcraft. She realizes that the judge is putting pressure on her to stick to her story. The judge has realized that he may have been mistaken on the idea that witchcraft is so prevalent in Salem. He realizes that the girls may be lying. If he agrees to hear Mary's story, he realizes he himself will look like a fool. He is more worried about his personal reputation than he is at finding the truth of the matter at hand.
Mary is torn between doing the right thing and saving her own life. She determines that her own life is more valuable than the truth. She does not want to hang. She changes her story in order to survive. She is afraid of Abigail. She fears what she can do to sway the judge against her.
Mary gives in to the pressure of those around her who are trying to prove that witches are among them.