Fresh from undergrad, I will be starting a math PhD program this upcoming fall in the United States. After several conversations with math professors and current PhD students, I noticed that several people advised having a sense of "urgency" right from the very start of your PhD program. Most recommended working to complete preliminary exams as soon as possible, but there was some variance in their opinions about when to jump into your thesis. One professor recommended "courting" potential thesis advisers by doing research projects with a professor or two during the first couple summers.
Do you agree with this call for urgency? If so, how do your recommend attacking those first 2-3 years of a (pure) math PhD program? Is it ever too soon to decide on your thesis topic? Recall that I do not have a master's, although I have taken three graduate-level algebra courses.
I'll first state I'm only a first year student in a math Ph.D. program so it's up to you to decide how serious you want to take my words.
I'd say yes to "sense of urgency" you describe in your question. Almost all professors I meet do tell me the first thing to do is to finish the exam requirements(preliminary/comprehensive, qualify) ASAP. They see passing exams as a "proof" of a student can do Ph.D. and will only take that student seriously after the requirement is finished. In addition, it's hard for Professors to give you any serious research work if they don't even know whether you will stay in the program or not.
That being said, it's not saying that you should never think about your research, another common advice I got is attending many seminars to explore my interest and determine the direction of my future research works.
It looks like you somehow already decide the direction of future works. Do you have a few potential advisors in mind? They are the people that can answer your "What to do in my first several years?" question accurately. Besides some common general advices and department's policy the answer of that question depends a lot on individual's condition and research field.
I notice you mention you've taken three graduate-level algebra courses before. Have you considered taking qualifying exam in algebra in the very beginning of your graduate study if that is possible (Of course this depends a lot on departments' policy)?