As-Sai’b bin Yazid (رضي الله عنه) reported: I was 7 years of age when I was taken to perform Hajj (journey). This was amid the time the Messenger of Allah Prophet Mohammad (صلى الله عليه وسلم ) performed the Hajjat-ul-Wada` (Farewell Pilgrimage). [Al-Bukhari].
This Hadith calls attention to the fact that it is permissible to take children to Hajj. The reward of their Hajj will be given to their parents. But when after attaining maturity the child becomes liable for Hajj, it will be necessary for him to perform it again because the one he has performed in childhood, will not be sufficient for him. The reason behind taking children to Hajj is to teach them how to perform this obligation.
Ibn `Abbas (رضي الله عنه) reported: The Prophet came across a caravan at Ar-Rauha’ and asked who the people in the caravan were. They replied that they were Muslims. They asked: “Who are you?” He [Prophet Mohammad (صلى الله عليه وسلم )]said, “I am the Messenger of Allah.” Then a woman lifted up a boy to him and asked: “Would this child be credited with having performed the Hajj (pilgrimage)?” Whereupon he (Prophet Mohammad (صلى الله عليه وسلم )) said, “Yes, and you will have a reward.”
[Muslim].
1283. Anas (رضي الله عنه) reported: The Messenger of Allah (Prophet Mohammad (صلى الله عليه وسلم )) performed the pilgrimage on an unsaddled camel which also carried his provisions (i.e., his Zamilah).
[Al-Bukhari]. www.masjidma.com