Is it necessary to know a lot of advance math to become a good junior high/high school teacher? By "advance math" I refer to Real Analysis, Abstract Algebra and Linear Algebra (to the level of Axler). I received mainly Bs in these courses with the exception of the intro-level Linear Algebra. Since I intend to be a teacher, is it necessary to have mastered these subjects at the elementary level? 


"Is it necessary to know a lot of advanced math to become a good junior high/high school teacher?"

It is neither necessary nor sufficient.
One of the best math teachers I've ever had probably doesn't remember much (if any) advanced math beyond linear algebra.  I don't know how he performed as a math student himself, but I'm not sure it really matters.  He is almost universally loved by his students, is very involved in the math team, and consistently challenges students to go beyond the routine algorithms and formulas.
On the flip side, I've also had teachers who certainly knew advanced math very well, but were unable to communicate effectively even the basics to students.
Of course, as Qiaochu points out, having an understanding of advanced math certainly couldn't hurt.  For example, it might help provide a deeper context for some of the math you're teaching.
Now I'm not a teacher myself yet, so maybe take what I'm saying with a grain of salt.  But as far as I can tell, good teaching is ultimately about dedication, effective communication, a responsiveness to student needs, and an interest in mathematics that goes beyond the textbook.  I think these are the important things.
