All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
If what you mentioned is true that your wife had an affair with another man and had illicit intercourse with him several times, she has done the worst of deeds, disobeyed Allaah and dishonored her husband's bed. So, she must repent to Allaah sincerely. What is strange here is that you are still having intercourse with her despite your knowledge of her evil act (adultery). In fact, this shows that you are approving immorality in your wife and humiliating yourself by renouncing the right to be in charge of her. Allaah The Almighty Says (what means): {Men are in charge of women.}[Quran 4:34] How come that you have intercourse with her without giving any reaction? Her practice is considered as disobedience, and Allaah The Almighty guided us to the steps of dealing with disobedient wives, as previously clarified in Fatwa 85402.
However, if you followed these steps with your wife and she did not repent, it would not be permissible for you to keep her as a wife lest she attributes to you a child who is not your own. What is the problem if she married another man after you divorce her? For further information, see Fatwa 89681.
As regards committing adultery, it does not dissolve your marriage as we previously clarified in Fatwa 84829.
Finally, we draw your attention to the fact that dissoluteness of the woman or her marriage to another man cancels her right to the custody of the children. Custody in this case is transferred to the more entitled woman next to her. For further information, see Fatwa 84618.