Community College or extension programs as a way of preparing for a Masters in Mathematics
I fear that not so many community colleges would offer the upper-division courses a math-major sort of person would want, especially to aim toward graduate school in mathematics. Further, you'd be needing letters of recommendation for grad school, and community colleges would not generate letters that would help you, since the letter writers (by far most often) would not be familiar with grad school from the side of mentoring and supervising grad students (even if they themselves did have a Ph.D.).

It is true that community colleges are usually much cheaper than "universities", but the coursework, context for coursework, and outlook of faculty teaching the upper-division courses you need, and their letters on your behalf, are things that you can't avoid but need.