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.
There is no objection in writing your name with your son's name. Actually, a child should be traced back to his father then to his family.
What is Islamically prohibited is to claim to belong to any one other than one’s father or family or tribe, as Waathilah Ibn al-Asqa' narrated that the Prophet said: “Tracing back a man to other than his father is among the greatest lies.” [Al-Bukhari and Ahmad]
Moreover, Sa'd Ibn Abu Waqaas and Abu Bakrah narrated that the Prophet said: “Whoever is traced back to other than his father while knowing that he is not his father, Paradise is forbidden for him.” [Al-Bukhari and Muslim]
Besides, the Prophet said: “Whoever is traced back to other than his father, or is related to other than his own master, there is upon him the curse of Allah, the angels, and all the people, and Allah will not accept from him any obligatory or supererogatory acts of worship on the Day of Judgment.” [Muslim]
Allah knows best.