What does the path to professorship in maths and computer science look like?
My ultimate goal is to be a professor and spend my life researching math topics in computer science, or just math. 


Not really. That is, it seems you are not seriously committed to any kind of research, you just like the idea of you being a professor. That is not good enough of a motivation. Don't presume to become a professional life-long researcher before you've done some significant research first. And you won't get such research done before you find a particular research subject (or a few subjects) which fascinates you, which is important to you enough emotionally that you want to spend a large chunk of your life exploring it.

When you tell us that you "want to research X. Or maybe Y"." - what I hear is: "I'm not particularly attached to any research problems."

So - your question is premature right now.