Essay I: Same-gender teachers may affect educational preferences by acting as role models for their students. I study the importance of the gender composition of teachers in math and science during lower secondary school on the likelihood to continue in math-intensive tracks in the next levels of education. I use population wide register data from Sweden and control for family fixed effects to account for sorting into schools. According to my results, the gender gap in graduating with a math-intensive track in upper secondary school would decrease by 16 percent if the share of female math and science teachers would be changed from none to all at lower secondary school. The gap in math-related university degrees would decrease by 22 percent ...