In the ancient Maya society, there was a special class of priest whose job was to teach the children of the nobles. That priest, or group of priests, taught math, science, astronomy, medicine, writing, and other subjects.
But there was no formal school for the children of commoners. Most people in the Maya Empire were farmers. The job of a child was to help their parents. By the time a child turned 4 or 5, they were given daily jobs to do, so they would learn how to be a farmer or a farmer's wife. If a parent had a specialized profession, such as a artist, the boys learned that skill, even if they had no talent for it. Girls learned from their mothers and boys from their fathers, whatever their job. As time went on, children were given more difficult tasks. By the time they were 15, they were considered an adult and fully trained for their life's work.
It was almost impossible for a commoner to move up. Once a farmer, always a farmer. Once a brick layer, always a brick layer. If a child exhibited incredible talent, especially in the arts, that child on occasion might be singled out to be taught a specialized profession. But this was rare. Social position in each city-state was tightly structured. Positions and jobs were hereditary.