All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is obligatory on any person who happens to commit Zina (fornication or adultery) to repent to Allah seeking forgiveness from this obnoxious act which is one of the grave major sins. Such a person should also screen himself/herself regardless of whether or not they are virgin. The evidence for this is the Hadeeth reported by Al-Haakim and Al-Bayhaqi from ‘Abdullah Ibn ‘Umar who narrated that the Prophet said: “Avoid these filthy things [sins] which Allah has forbidden, but if anyone commits any of them, then let him conceal that which Allah has concealed, and let him repent, for whoever discloses to us what he has done, we will carry out the punishment prescribed in the Book of Allah the Al-Mighty on him.”
Now, when a girl happens to commit Zina and becomes pregnant, she should repent and be patient. But it is strictly forbidden for her to abort her fetus as doing so means adding yet a worse sin. She should also not go to the man with whom she committed Zina or to any other man who is not Mahram to her as that makes the matter worse, above all if she lets him have sex with her again outside the marriage contract that fulfills all the Islamic conditions (guardian, witnesses, etc.).
Anyway, this man and this woman should fear Allah and repent to Him. It would be more appropriate that they change their situation from illegal to legal by getting married according to the Sharee’ah. Finally, any children that are born outside wedlock life are considered from Zina and should not be traced back to the fornicator; rather, they should be traced back to their mother.
Allah knows best.