Most folks I think are familiar with the image of the one-room rural schoolhouse in the United States and Canada, often with a single teacher - often a woman - such as in Back to the Future Part III. How realistic was this, given how limited educational opportunities for women were in the 19th century? Did single, educated women really get sent out to rural communities to teach, or is this more of a Hollywoodism?
Schoolmarms! A word near and dear to my heart! I've written about this topic in a few different places and have pulled from those writings in my answer. So, the first thing to tackle is the word. Schoolmarm (and its sister, School Ma'am) was a catch-all term that emerged in mid-1800s to refer to a woman schoolteacher. There was no male equivalent but it should be noted that the term Schoolman (a catch-all word that would refer to a male school administrator, a state-level politician who oversaw education, a college of education professor, a school board president - basically a man in a position of authority in education) emerged around the same time. The words, though, did not indicate equal levels of power. A schoolmarm could become an administrator, but she'd still be a schoolmarm and a schoolman may have been a former teacher, but the word wasn't generally used to describe men who taught in the K-12 classroom.
Depending on which resource from the 19th and 20th century that you read, a schoolmarm is a vibrant young, unmarried woman teacher (Evening Star, 1915; Gallipolis Journal, 1852) or an elderly, unattractive woman teacher who has lost her joie de vivre (The Daily Record, 1953.) She is described as gentle and kind. She is harsh and will beat her students to achieve her pedagogical goals. She is wise and a rich source of knowledge. She is naïve and knows nothing about the “real” world. She is terse. She is patient. She is someone to be pitied. She is someone to be admired. Rural, urban, suburban ... married, single, widowed, divorced... didn't matter. The word could be used to describe any woman in education.
One of the reasons it's helpful to contextualize the word is that it helps us understand the feminization of the profession. For most of the 1700s, a schoolteacher typically came in two varieties: a young man teaching as a temporary thing on his way to something else or a high profile tutor that families of means would pay generously to get their son ready for one of the Colonial Colleges. The system worked, mostly because very few students - mostly white, non-disabled - attended school. There was a loose, informal network of Dame schools, academies, charity, and tuition-based schools that existing along with early high schools but there was very little norming across the system. As the idea that a literate population was a net good for the country took hold, the work began to expand the notion and structure for a formal public education system.
Conceived as the "common school movement" by men like Horace Mann, the idea was basically to have a schoolhouse in every village and town across the country, starting in the Northeast and to have taxpayers fund (some, most, or all - depending on the state and region) the construction and maintenance of said schoolhouse. That many schoolhouses, though, would require a massive influx of teachers. Mann partnered with Catharine Beecher, an activist who saw teaching as an outlet for the hundreds of spiritually-minded young New England women sitting at home, waiting to get married and be mothers. Through what can best be described as a PR campaign, Beecher and Mann recruited hundreds of young, unmarried women to the ranks of teaching. (There was, to make it plain, the added bonus that taxpayers could pay a single woman a great deal less than they would have to pay a male teacher with a family.)
To be sure, women were part of early American education - as leaders of Dame schools or teachers of a school's summer session, which was seen as less "academic" than the winter session - but their involvement was minimal and atypical. What Mann and Beecher and other early common school advocates did was to make it socially acceptable for a young, unmarried woman to work as a schoolteacher and be trusted with other people's children. This sentiment was deeply rooted in Protestantism, and position teaching as a parallel secular track to a young man's entry into the clergy. Mann and Beecher didn't act alone and didn't have access to any federal levers of power to bring their vision to light but they were remarkably successful in terms of normalizing school as something children should do and teaching as something women could do.
The rise of common schools happened concurrent to a number of social shifts regarding what content adults thought young people should know, the rise of Americana as a way to encourage patriotism among young people - especially young immigrant children, and ideas around teacher training. Schoolmen often took trips to Europe to get a sense of how their education systems work and brought back ideas, most notable, bureaucracy as a way to support and organize schools and teacher training colleges (known as Normal Colleges or Schools), and an expanded understanding of the stages of childhood. In the midst of all these changes, teaching as women's work became a cultural and social norm. At one point in the late 1800s, upwards of 50% of all white women in Massachusetts had worked as a teacher at one point in her life. (More on teaching as "women's work" here.)
Which is to say, the image of a young, white, unmarried woman going to a rural community to teach does reflect what actually happened. She may have been from the community and traveled east to attend a Normal college or more likely, traveled west from the east coast, lured by the idea she could serve her country and her God by shepherding a community's youth towards adulthood. In some cases, she did attend a Normal college and received training in pedagogy and school management. In others, she had only a high school diploma and was maybe a year older than her oldest students. In virtually all cases, she was expected to leave her job as soon as she got engaged or married. She was expected to adhere to the cultural and social norms of the community she joined (in some cases, this meant avoiding alcohol and being alone with a man, in others, she had to make sure she didn't get caught doing said things.)