Mathematics is an important subject to study. But the presence of mathematical and gender stereotypes affects the self-perception of mathematical abilities for boys and girls. In the future it may be associated with the choice of educational and career trajectories. In turn, the teacher acts as a guide in the formation of these ideas and motivation for the subject. Among the factors of the impact of the teacher on these formations, one can distinguish: the teacher's pleasure from teaching mathematics, their beliefs and ideas about mathematics, including teachers’ self-confidence in order to teach mathematics, etc. At the same time, the role of the teacher may vary depending on the structure of the educational process. This article discusses how important is the teacher in the educational environment when choosing an educational trajectory, as it develops interest to the subject and motivation for further learning on the example of three countries: Russia, Kyrgyzstan and Kazakhstan. The research methodology is a case-study research strategy: research I - the study of the attitude and motivation of schoolchildren to study mathematics, the role of the teacher in its study; research II - evaluation of the effectiveness of separate education based on the opinion of teachers. Our research showed that the main motivational factors are the content of education, which forms a set of knowledge about different types of careers, and the individual characteristics of teachers who introduce students to different subject areas. And segregated education can become an alternative strategy for achieving gender equality.