Praise be to Allah.
Islamic teaching pays a great deal of attention to the issue of lineage or confirmation of paternity; it accepts the confirmation of paternity on the basis of the slightest evidence whilst it sets out stringent conditions for allowing denial of paternity.
It says in al-Muhadhdhab by ash-Shiraazi (3/84): The husband’s paternity should be accepted and confirmed if a woman produces a child that may or may not be the husband’s, on the basis that precedence should be given to confirming paternity rather than denying it.
The teachings of Islam rule that the child belongs to the husband, as is indicated by the words of the Prophet (blessings and peace of Allah be upon him): “The child is for the (owner of the) bed (i.e., the husband) and the fornicator gets nothing.” Narrated by al-Bukhaari (2053), Muslim (1457)
Based on that, these children to whom your wife gave birth when she was married to you are your children and are to be attributed to you, and that is not to be denied merely on the basis of this claim of their mother’s.
With regard to the question of whether li‘aan is required, you are not obliged to engage in li‘aan in order to deny that they are your children. But if you think it most likely that the woman is telling the truth, then it is permissible for you to deny that they are your children by engaging in li‘aan, and it is permissible for you to refrain from engaging in li‘aan and to attribute them to yourself, based on the words of the Prophet (blessings and peace of Allah be upon him): “The child is for the (owner of the) bed (the husband)”.
It says in Fataawa al-Lajnah ad-Daa’imah (20/339): If a married woman commits zina and becomes pregnant – then the child is to attributed to the (owner) of the bed – i.e., the husband, because of the saheeh hadeeth. If the owner of the bed wants to deny the child by means of li‘aan, he may do so in front of the sharee‘ah court. End quote.
And Allah knows best.