I recently heard that halacha prohibits a woman who had a (consensual) affair from remaining married to her husband, even if both the wife and husband wish to remain married. Is this correct, and if so, what sources are there for this rule?
רמב"ם הלכות גירושין פרק יא הלכה יד
ובכלל לאו זה שכל אשה שזינת תחת בעלה נאסרה על בעלה ולוקה עליה שנאמר אחרי אשר הוטמאה והרי נטמאה, אלא אם כן היתה אשת ישראל שנאנסה, לפיכך כל אשה שנאסרה על בעלה על ידי קינוי וסתירה אם בעל אותה מכין אותו מכת מרדות, ואם עבר והחזירה אחר שגירשה יוציא בגט.
Included in this prohibition is that every woman who engaged in adulterous relations becomes forbidden to her husband. He is punished by lashes [for engaging in marital relations with her], as [implied by the inclusion of the phrase] "after she has become tainted" in [Deuteronomy 24:4]: "And [an adulterous woman] has been tainted." There is one exception: the wife of an Israelite who was raped.
Therefore, whenever a woman becomes forbidden to her husband, because she violated his warning against entering into privacy with another man, and he engages in relations with her, he is punished by stripes of rebellion. If after divorcing his wife [for such reasons], the husband transgresses and remarries her, he must divorce her.