A boy of nine years of age is not one of those who are accountable for fasting according to sharee’ah, because he has not yet reached puberty. But Allah has enjoined parents to raise their children to do acts of worship. Allah commands them to teach their children the prayer when they are seven years old, and to smack them if they do not do it when they are ten years old.
The Sahaabah (may Allah be pleased with them) used to make their children fast when they were small so as to make them get used to this great act of worship. All of that is indicative of great concern to raise one's children with the best of attributes and deeds.
With regard to prayer:
The Messenger of Allah (blessings and peace of Allah be upon him) said: “ Teach your children to pray when they are seven years old and smack them if they do not pray when they are ten years old, and separate them in their beds.” Narrated by Abu Dawood (495) and classed as saheeh by al-Albaani in Saheeh Abi Dawood.
With regard to fasting:
It was narrated that al-Rubayyi’ bint Mu’awwidh ibn ‘Afra’ (may Allah be pleased with her) said: On the morning of ‘Ashoora’, the Messenger of Allaah (blessings and peace of Allah be upon him) sent word to the villages of the Ansaar around Madeenah, saying: “Whoever started the day fasting, let him complete his fast, and whoever started the day not fasting, let him complete the rest of the day (without food).After that, we used to fast on this day, and we would make our children fast too, even the little ones in sha Allaah. We would make them toys out of wool, and if one of them cried for food, we would give (that toy) to him until it was time to break the fast.
Narrated by al-Bukhaari (1960) and Muslim (1136).
‘Umar (may Allah be pleased with him) said to one who was drunk during Ramadan: “Woe to you! Even our children are fasting!” And he hit him. Narrated by al-Bukhaari in a mu’allaq report, Bab Sawm al-Subyaan (Chapter on the fast of children).
The age at which parents should start teaching their children to fast is the age when they are able to fast, which varies according to the physical constitution of each child, but some scholars have defined it as the age of ten years.
With regard to means of helping children to get used to fasting, that may involve a number of things, such as:
1. Telling them of the virtues of fasting and that it is one of the most important means of entering Paradise, and that in Paradise there is a gate called al-Rayyaan through which those who fast will enter.
2. Prior experience of getting used to fasting, such as fasting a few days in the month of Sha’ban, so that fasting in Ramadan will not come as a shock to them.
3. Fasting part of the day and increasing the time gradually.
4. Delaying sahoor until the last part of the night. That will help them to fast during the day.
5. Encouraging them to fast by giving them rewards each day or each week.
6. Praising them in front of the family at the time of iftaar and sahoor, because that will raise their morale.
7. Instilling a spirit of competition for the one who has more than one child, whilst remembering that it is essential not to rebuke the one who is struggling.
8. Distracting the one who gets hungry by letting him sleep or play permissible games that do not involve effort, as the noble Sahaabah used to do with their children. There are suitable programmes for children and cartoons on the trustworthy Islamic channels with which you can distract them.
9. It is preferable for the father to take his son -- especially after ‘Asr -- to attend the prayer and lessons, and to stay in the mosque to read Qur'aan and remember Allah.
10. Arranging visits during the day and night to families whose young children are also fasting, so as to encourage them to carry on fasting.
11. Rewarding them with permissible trips after iftaar, or making the kinds of food, sweets, fruits and juices that they want.
It should be noted that if the child becomes too exhausted, you should not insist that he completes the fast, so that this will not make him hate acts of worship or lead to him lying or make him sick, because he is not yet one of those who are accountable. It is important to pay attention to this and not be harsh with regard to telling the child to fast.
And Allah knows best.