I look at some truly impressive projects like CLASP which sprang into existence not because of someone noodling around, but because they had a bigger goal which required the team build it.
So my advice to any mathematician who feels lost, like they don't know what to work on, would be to go collaborate with someone who has an actual goal, to look for inspiration in the kinds of math they need.
Today, there are a lot of opportunities to jump forward that only get capitalized on through coincidence (e.g. two people bump into each other at a conference, or researcher happens to have a colleague working on a related problem through the lens of a different discipline). If AI does nothing but guarantee that everyone will have such a coincidence by serving as that expert from a different discipline, that will still be a massive driving force for progress.
The question of "whats a mathematician to do" is still clear: you need to find and curate and clearly express interesting and valuable problems.