Is it permissible for parents to beat their children, if children are not offering salah?
A child should be taught at the age of 7 to pray then if they refuse to pray at the age of 10, they should be smacked lightly. This is to train the child to pray so that they will not refuse to pray at the age of puberty. This summarizes the following quotes:
Abu Dawood (459) and Ahmad (6650) narrated from ‘Amr ibn Shu’ayb from his father that his grandfather said: The Messenger of Allaah (blessings and peace of Allaah be upon him) said: “Teach your children to pray when they are seven years old, and smack them (lightly) if they do not pray when they are 10 years old, and separate them in their beds.” Classed as saheeh by al-Albaani in al-Irwa’ (247).
Ibn Qudaamah (may Allaah have mercy upon him) said in al-Mughni (1/357): This telling and discipline is prescribed in the case of children in order to train them to pray, so that they will be used to it and it will become their habit, and they will not forsake it when they reach puberty.
Al-Subki said: The guardian must tell the child to pray when he is seven years old and smack him (lightly) if he does not do so when he is ten...
From the above you should have learned that smacking the child in this instance is • when the child reaches the age of 10 where training has been undertaken from the age of 7 upwards and they then refuse to pray at 10. • the smack must be gentle and therefore must also avoid certain areas of the body which would otherwise cause the child pain. • it's done so that the child will pray by the time they reach puberty without hesitation
And Allah knows best