If a man and woman have extra-marital relations and later they get married, how should they repent. Should they confess their crime? Should this matter be reported matter to the authorities
If we deliberate on the various forms of Islamic punishments, in particular on the punishment of Qadf (wrongly accusing someone of fornication) mentioned in the Qur'ān, it becomes evident that in sins that do not relate to the violation of rights of a party, the Almighty does not like that a criminal confess to his crime himself or that those who are aware of his crime report this matter to the authorities.
The Prophet (sws) is reported to have said:
He among you who gets involved in such filth should hide behind the veil stretched out for him by Allah, but if he unfolds the veil, we shall implement the law of Allah upon him. (Mu'attā, Kitābu'l-Hudūd)
Similarly, he once told a person:
If you had hidden the crime of this [person], it would have been better for you. (Mu'attā, Kitābu'l-Hudūd)
If a man and a woman have committed such a sin, they should sincerely repent before God and keep asking His forgiveness. To cleanse themselves internally from the effects of this sin, they can adopt two measures:
a. Keep some fasts.
b. Spend some amount in the way of Allah.
This is not an atonement prescribed by the Almighty; however it is a kind of self-imposed penalty that helps both in purifying the inner self and in lessening the burden of guilt.
Consequently, in case of Qadf, the law of Islam is that the accuser shall have to produce four witnesses. Anything less than this will not prove his accusation. Mere circumstantial evidence or mere medical examination in this case is absolutely of no importance. If a person is of lewd and loose character, such things have a very important role, but if he has a morally sound reputation, Islam wants that even if he has faltered, his crime should be concealed and he should not be disgraced in the society. Consequently, in this case, it wants four eye-witnesses for the testimony to initiate the hearing, and if the accuser fails to produce them, it regards him as guilty of Qadf. The Qur'ān says:
Those who accuse honourable women and bring not four witnesses as an evidence [for their accusation], inflict eighty stripes upon them, and never accept their testimony in future. (24:4)