In Islam, one has to reach the puberty to be liable for worship. For a girl, this responsibility begins with her first period and for a boy it begins when his reproductive system begins functioning. There is no liability before puberty.
It is a duty of parents to prepare their children for this responsibility. Children need to be taught about basic practices such as prayers and fasting from the age of seven on. They should be able to pray properly and fast from time to time when they are ten, though they can never be urged to it as they are not responsible before puberty; yet, they should be informed suitably according to their age about the upcoming responsibility. Everything should be explained in a proper way, without threatening or scaring the child. This duty is mainly on the shoulders of parents.
According to a hadith, the Companions familiarized their pre-puberty children to fasting and when they cried for food, they distracted them with toys until fast-breaking time. (Bukhari, Fasting, 47)