It appears to me most research in mathematics requires close studying of the work done by the previous generation, so this seems to rely on mathematicians keeping track of and recording the new knowledge which is discovered/created as well as there always being a new generation of people to carry on that task after the current mathematicians die. However from research online and questions like this one it appears there is maybe one mathematician per every 50,000 people on earth and in the United States alone probably no more then 9000 actual mathematicians that are engaged in research. Thus all of this seems very fragile/delicate, these people are already very rare so whose to say the number might not drop to half that in the next few decades?
Also given that people have contributed thousands and thousands of years of work to compiling all this information shouldn't there be some kind of mass archive to protect it? Like a seedbank or something? Sorry if this sounds stupid, but I guess my more pertinent question is where are these new people coming from who want to study mathematics? From looking online and talking with others, it seems that these people who go on to become mathematicians all overwhelming have experiences of being engaged in or encouraged to participate in STEM areas, so I'd guess a large component is childhood factors, which I suppose makes sense as in order to get engaged in mathematics it seems most have to study or work at it for a long time, it also seems a large number of the math undergraduates that I talked to had parents who were software engneers, teachers, etc. so thats likely a factor.
What are other variables correlated with perusing research in mathematics? I can't seem to find any studies, though I'd guess its just because they are so incredibly rare (to reiterate I'm talking about people engaged in research, not people in industry or teaching high school or something). Does anyone know of any studies or writings on this topic? How about on the stuff regarding some kind of "global archive" or "mass directory" like a seedbank to ensure all past and future work in math is not lost/forgotten/failed to be taught to new people? Again sorry if this all sounds stupid, I tagged this as "soft question".