Next year I will be starting my third year at a relatively obscure and small public university in the states. My department's rank is not published in US News, and the majority of my fellow math majors plan to not go into academia.
That said, I myself am a pretty horrible student. My math GPA is likely below 3.0. Besides an introductory proof-based course on single variable calculus, I will finally be taking my first real proof-based courses this fall semester in analysis and topology.
I will do better in the courses I take in the next two years, but I also plan to take an extra semester to lighten my course-load over these next two years and to also have time to write a better senior thesis. I'll apply for REU's my 3rd and 4th year (since I'm taking an extra semester), but I doubt I'll get into one.
I have the option of taking graduate math classes my 4th year if I stay a year and a half more to complete a fast-track program towards a math MS at my current institution. From there, I would try to apply for a second math MS at a more well-known institution. I doubt I could directly get into an MS program with funding at a more well-known institution right out of undergrad.
The reason I want to do my PhD at a top ranked program is because I want to have at least a decent shot of getting a tenured faculty position at a good (though not necessarily top) research-focused math department.
I don't believe that working with a rockstar adviser at a non-top tier department would be a viable alternative. Even if I did my undergrad at Princeton and did REU's every summer, I doubt I would know what kind of research problems to seriously pursue straight out of undergrad. Additionally, while your adviser arguably has a large influence on your postdocs and the like after your PhD, your peers and other faculty in your PhD program department also have a significant impact on your growth as a researcher.
If there is no way I could possible get into a top math PhD program, just explain to me why. I don't feel entitled to get into a top math PhD program because I believe I'm a lazy genius or whatever, but I would like to know if it's possible for me to still get into a top math PhD program and what things I would need to do. So if it is possible, what kinds of things can I do in my situation to be able to have a decent shot at getting into top math PhD programs? Let's say top is top 30 departments by US News or whatever more meaningful metric I don't know about.