There is more than one meaning of the term function. The rigorous one-to-one function definition has its place, but so does the more generalized relationship aspect of it.
If you think this dispute concerns whether functions must be one-to-one, you are hopelessly confused.
No, I'm not. But I'm also not interested in being dragged down into a pedantic argument that has no practical value, and has no value in the real world. Also, I'm a nice person.
Many nice and well-meaning teachers do a poor job of teaching mathematics. That isn't the only reason math scares so many people, but it's one of the reasons.
Many elementary school teachers are themselves scared of math, so they teach as little math as possible and stick to lesson plans prepared by others for the math they do teach. They're trying to do as little harm as possible, which is worthy of respect, but they are not doing a good job of teaching math.
Some teachers do harm by passing their own misconceptions about math on to their students. A few students will overcome those misconceptions on their own or when they encounter better teachers later on. Most students will just be confused when their math teachers contradict each other; in their confusion, they're likely to conclude they aren't good at math instead of placing blame on their teachers, where it belongs.
If young students come to realize the misconceptions they were taught were white lies or honest mistakes, like Santa Claus or religious dogma, math may become for them another example of the false things adults tell kids. Others may conclude math is, like politics, mostly a matter of competing opinions being advanced by opinionated people seeking to prop up their own self-esteem.
None of those outcomes are good, but an even more pernicious harm is done by teachers who, finding themselves challenged or at the limits of their own mathematical knowledge, try to maintain their authority by saying they're not going to get dragged down into a pedantic argument that has no practical value, and has no value in the real world.
When teachers try to justify their flight from mathematical precision by saying it has no practical value, they discourage students from putting forth the effort needed to think clearly and critically about mathematics. That has the side effect of discouraging students from putting forth the effort needed to think clearly and critically, period.
When teachers suggest it is not nice to worry about the details, they undermine one of the major life lessons to be learned from studying mathematics: Details matter.
All the people out there who lament the atrocious lack of critical thinking skills exhibited by kids these days might want to give a little thought to the role that mathematics plays in that skill set.
Learning mathematics promotes critical thinking in several ways.
Math teaches you it's easier to be wrong than right. In mathematics, two people who disagree with each other can't both be right. It's quite likely that both are wrong.
Math teaches you it is possible to disagree without being disagreeable.
Math teaches you that two people who disagree with each other can, with sufficient effort, find at least one flaw in their arguments. Math also teaches you that finding flaws in arguments is best done in cooperation with someone who disagrees with you.
Math teaches you it's okay to be wrong, but it's not okay to remain content with being wrong.
Math teaches you it is especially not okay to remain wrong while throwing a hissy fit, or
suggesting those who disagree with you are motivated by religious fundamentalism, or
boasting of your mathematical prowess while speaking of others as toddlers, or suggesting it wouldn't be nice to discuss some dubious mathematical claim you've made. (That is of course an incomplete list of the modes of argument that are not okay in any discussion of mathematics.)
Math teaches you that details do matter.
In all of those ways, learning mathematics promotes critical thinking.
One thing to notice here is that I haven't had to mention any particular kind of mathematics. If any kind of mathematics is taught well, it promotes critical thinking.
Formal logic is the language of critical thinking.
Math also teaches you the difference between valid and invalid arguments. That lays a foundation for formal logic, which formalizes that distinction and provides in turn a foundation for higher mathematics.
It is certainly possible to think critically without knowing anything about formal logic. On the other hand, formal logic can assist critical thinking. The basics of formal propositional logic could be taught in high school; quantifiers and metatheory can wait until college.
Formal logic is important, but not as important as the desire to reason logically. That desire can and should be developed by teaching math in elementary school. All too often, math is taught in ways that smother that desire.
That's one of the reasons math scares so many people, and that's one of the reasons critical thinking is so rarely encountered.