It's not so hard to get a PhD in math, in the sense that if you're willing to attend a low-ranked program and have at least a moderate affinity for mathematics, you could probably do it. It takes a lot of time to learn all the prerequisites, but that's why the undergrad degree is 4 years and the PhD typically 5+. Then you just find a suitable advisor, ask to be handed a dissertation problem and some ideas for the solution, write down that solution, and graduate. Anyone who's been doing math research for a few years has a collection of problems they know how to solve but haven't written up for various reasons, which they can give for this purpose. (Usually: the question is too boring or simple, no one cares, and there are bigger impact things to do instead).
Doing research that meaningfully advances mathematics, as opposed to being make-work in service of getting a degree? Much harder.