Praise be to Allaah.
If this woman has mended her ways and has repented to Allaah and has given up haraam things and going out with men, and there are no reasons to be suspicious about her, then our advice is that your friend should keep her and conceal her past mistakes. Whoever conceals a Muslims faults, Allaah will conceal his faults in this world and the next. Allaah is Forgiving and Merciful, He forgives and accepts the repentance of the one who turns to Him in repentance. So we should be forgiving and should treat the one who has repented in accordance with the way he is now, and help him to continue to repent. The one who has repented is like one who has never sinned at all. If the husband conceals his wifes past mistakes and treats her well, this will be of immense benefit in helping this woman adhere to the straight path and encouraging her to continue living a life of purity and chastity; her husband will also have a great reward for concealing her faults, keeping her chaste and helping her to avoid evil and stay on the straight path, living under his care in a pure atmosphere in the marital home.
If this woman is still persisting in mischief and going out with men and committing haraam actions, and does not repent despite being advised to do so, then we do not suggest that he should keep her at all. Let him get rid of her and Allaah will provide him with another wife.
If she has repented, but he cannot bear what she has done in the past, and he is tormented with bad thoughts that give him sleepless nights, and he is scared that if he keeps her he may mistreat her even though she has repented, then he can divorce her so as to give himself peace of mind and avoid mistreating her. But he should look at the matter anew and think long and hard about the advice we have given here. Let him think about himself too: maybe he has made mistakes in the past, or will do so in the future. We ask Allaah to help him to make the right decision and to guide him to the best way. Allaah is the Source of strength and the Guide to the Straight Path.