Children are not required to fast as they are not considered to be accountable for their actions due their young age.
Ali ibn Abu Talib reported that the Prophet (s) said: “There are three (persons) whose actions are not recorded: a sleeper till he awakes, a boy till he reaches puberty, and the insane till he comes to reason.” [Sunan of Abu Dawood Hadith 3.4389]
It is still preferred to try to get the children into a habit of fasting. This can be from a young age, bearing in mind their health. This develops the same characteristics of gratitude, empathy and strong will.
Ar Rubi bint Muawadh reported, “The Prophet sent a messenger to the village of the Ansar in the morning of the day of ‘Ashura’ (10th of Muharram) to announce: ‘Whoever has eaten something should not eat but complete the fast, and whoever is observing the fast should complete it.’ “She further said, “Since then we used to fast on that day regularly and also make our boys fast. We used to make toys of wool for the boys and if anyone of them cried for, he was given those toys till it was the time of the breaking of the fast.” [Sahih Al-Bukhari Hadith 3.181]
However, just as children are encouraged to start praying from the age of seven, and reprimanded from the age of ten, the same is also applied to fasting.
It should be noted that a key benefit of fasting is to develop self-restraint and discipline and this is equally, if not more important, in children.
In summary therefore, although children are not required to fast, they should be encouraged from the age of seven as long as they are happy and able to undertake the fast. At the age of ten they should be told to fast so that they become accustomed to it, as they will be held accountable from the age of puberty.