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, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
The child must be attributed to their true, legitimate father and not to another person, whether it be the mother's husband or anyone else. Allah the Almighty says: {Nor has He made your adopted sons your [true] sons. That is [merely] your saying by your mouths, but Allah says the truth, and He guides to the [right] way. Call them by [the names of] their fathers; it is more just in the sight of Allah.} [Quran 33:4-5]
Showing respect and gratitude does not justify attributing oneself to anyone other than one’s biological father. Similarly, it is not permissible to go against Islamic Shariah out of fear of embarrassment or any similar reason.
Furthermore, believing that a mother's marriage to another man makes him the father of her child (from a previous marriage) is incorrect. However, there should be a relationship of respect and good treatment between them (the child and his stepfather). Islam encourages love, harmony, and reciprocating kindness, especially in cases where a special relationship, such as in-laws, exists.
Allah knows best.