Halacha 1
Teachers of small children should be appointed in each and every land, in each and every region, and in each and every village.
If a village does not have children who study Torah, its populace is placed under a ban of ostracism until they employ teachers for the children. If they do not employ teachers, the village [deserves to be] destroyed, since the world exists only by virtue of the breath coming from the mouths of children who study Torah.
Halacha 2
Children should be brought to study [under a teacher's instruction] at the age of six or seven, according to the child's health and build. Below the age of six, he should not be brought [to a teacher].
A teacher may employ corporal punishment to cast fear upon [the students]. However, he should not beat them cruelly, like an enemy. Therefore, he should not beat them with a rod or a staff, but rather with a small strap.
[The teacher] should sit and instruct them the entire day and for a portion of the night, to train them to study during the day and night. The children should not neglect [their studies] at all, except at the end of the day on the eve of the Sabbaths and festivals and on the festivals themselves. On the Sabbath, they should not begin new material. However, they should review what was learned already.
The children should never be interrupted from their studies, even for the building of the Temple.
Halacha 3
A teacher of children who leaves the children and goes out, or [remains] with them but performs other work, or is lazy in their instruction, is included in [the admonition (Jeremiah 48:10)]: "Cursed be he who performs God's work deceitfully.” Therefore, it is only proper to select a teacher who is God-fearing, teaches them at a fast pace, and instructs them carefully.
Halacha 4
A man who is unmarried should not teach children, because of the mothers who visit the children. No woman should teach children, because of the fathers who visit the children.
Halacha 5
[A maximum of] 25 students should study under one teacher. If there are more than 25, but fewer than 40, an assistant should be appointed to help him in their instruction. If there are more than forty students, two teachers should be appointed.
Halacha 6
A child may be transferred from one teacher to another teacher, who is capable of teaching him at a faster pace, whether with regard to the Written Law itself or grammar. This applies when both are located in the same city and there is not a river between them. However, a child should not be forced to travel from city to city, or even from one side of the river to the other in the same city, unless there is a strong bridge, which is not likely to fall readily, over the river.
Halacha 7
If a person [whose house opens] to an alleyway [to which other houses open] - or even one [whose house opens] to a courtyard [to which other houses open] - desires to become a teacher of children, his neighbors may not protest against his decision.
Similarly, should one teacher of children come and open a schoolroom next to the place [where] a colleague [was teaching], so that other children will come to him or so that the children [studying under his] colleague shall come to him, his colleague may not lodge a protest against him, as [Isaiah 42:21 states]: "God desired, for the sake of His righteousness, to make the Torah great and glorious."
Teachers of small children should be located in each and every land, in each and every region, and in each and every village. - Bava Batra 21a declares:
Remember that man for good! Yehoshua ben Gamla is his name. Were it not for him, the Torah would have been forgotten by the Jewish people.
Originally, a person who had a father would be instructed by him, while a person who had no father would not be instructed...
[Afterwards,] they instituted [the practice of] employing teachers of young children in Jerusalem [as implied by the verse]: "From Zion shall go forth the Torah."
Nevertheless, whoever had a father would be taken [to Jerusalem], while one who did not have a father would not be taken. [Therefore,] they instituted [the practice of] employing teachers in every region. They would begin study at sixteen or at seventeen.
However, if a [student's] teacher were angry with him, he would scoff at him and leave. [This situation persisted] until Yehoshua ben Gamla came and instituted [the practice of] employing teachers of young children in each and every land, in each and every region, and in each and every village. They would bring them [to the schools] at the age of six or seven.
This practice was continued in the subsequent generations. Even though the dispersion of the Jewish people and the subjugation to the gentile powers made the management of their communal affairs more difficult, throughout the ages we find references to the establishment of communal programs of education in both the codes of Jewish law and the chronicles of Jewish history. (See Ramah, Choshen Mishpat, 163:3; Shulchan Aruch HaRav, Hilchot Talmud Torah 1:3.)
Originally, it was customary for the community to impose taxes to pay for the education of all the children, whether their parents were rich or poor. However, at present it has become customary for each parent to pay for his own child's education. However, if he lacks the financial means to do so, the community is obligated to accept this burden.
If a village does not have children who study Torah, the city's populace is placed under a ban of ostracism - See Chapter 7, Halachah 5 for a precise definition of this term.
until they employ teachers for the children. If - these measures do not motivate the inhabitants to change their ways and....
they do not employ teachers, the city [deserves to] be destroyed - The Rambam's statements are based on Shabbat 119b. Though our text of that passage differs slightly from the statements here, in the various commentaries and codes (e.g., the She'eltot of Rabbenu Achai Gaon, the Halachot of Rabbenu Yitzchak Alfasi), we find various versions of that passage. Hence, it is possible to assume that the Rambam's statements are a quote from his text of the Talmud.
for the world exists only by virtue of the breath coming from the mouths of children who study Torah. - for their breath is not tainted by sin (Shabbat, ibid.). Based on the latter statement, some authorities require the community to support children's study only until they reach bar-mitzvah, since afterwards they no longer possess this quality.