Let us not think for a moment that all teachers are capable of teaching math. Same is true for any subject.

Back in Sri Lanka, where I learned math up to University, we had specialized math teachers starting in grade six. So perhaps that is the way forward - assigning specially trained teachers to teach math starting form a lower class, instead of asking the homeroom teacher to do it.