Unless you have a full-ride scholarship, go to pleb-tier state school. If you are studying a STEM field you'll have to learn the exact same math and science as the Harvard and Stanford grads, but you'll do it for far cheaper if you attend a public university in your state of residence. If you want to do a postgrad program, don't worry: top tier schools will come sniffing if you're good enough, no matter where you're…
I went to a "pleb-tier" [1] school for undergrad and then to a top-tier university for grad school.
It's just not true. There is a huge difference in the quality of education, especially in STEM fields. And most especially in Math. "pleb-tier" schools will get through everything in Harvard's Math 55 if they're lucky. Not even exaggerating -- the first year at Harvard covers what you'll get in four years of honors track at a "pleb-tier" place.
And then there's the recruitment pipeline. Coming out of top-tier school I had multiple 300k-500k offers without even applying for any jobs. Out of pleb-tier school, I wasn't getting anything over 80k and that was with lots of networking. CS and Math are two of the rare fields where phd school has, IME, a positive expected value, as long as you're substantially trading up credentials.
IMO the optimal route is as follows (at least in STEM):
* Is your state flagship within a 1 hour drive and top-10 in your field? If so, that option is a complete no-brainer.
* 3/4+-ride to a top 10 place outside of commuting distance, or a 1/2 ride to a top 10 place within commuting distance? Again, no brainer.
* Otherwise, the calculus becomes harder. Your best bet is probably to aim for a PhD at a tippy top school (top 5 or so), but getting into tippy top phd program from a "pleb-tier" is not nearly as easy and you're making it out to be... especially in older/more saturated fields like Math.
--
[1] FWIW I don't like this terminology but... whatever.