I've known a friend for few years, she had been divorced previously with a son to take care of on her own and then she got of the track for a little bit and was with a guy for few months without doing nikah and she conceived his child.
As soon as he discovered that she was with his child, he refused to own the child as father and wanted to get rid of that child. If she refused, he would beat her up, to manipulate her physically, mentally and in any way possible, to convince her do it. But she said she won't do it as it's murder of that little soul and she wasn't prepared to do this sin. He won't accept it but carried on beating and torturing her to change her mind. So she left him, with no means left for him to get back to her or contact her for the sake of that child and repented for what she has done. Now the baby is due in a week or so.
She is concerned about the child having an unpaternal upbringing, and having no means ownership to him as a father. She requested that I make nikah with her and give the child my name to secure its paternity values in the society.
My question is: Is it halal or right just to make nikah just for the sake of giving my name to a child as father?
We don't have any intention of being in an Islamic marriage except that particular purpose. Can I have your guidance on this according to Allah (SWT) and his Rasool (PBUH). She can't ask for marriage from the biological father, as he's a real threat to the child's life. Considering that she lives in Pakistan, they would be in real danger if she sees the guy.