Edit: If you'd like a better medicine based one, look to radiology, where AI is an omnipresent tool but claims that radiologists are no longer needed, based on an ignorant view that a radiologist's job is "classify images according to what diseases they indicate" have only contributed to a crippling worldwide shortage of radiologists.
Up until now the prize in pure (as opposed to applied) mathematics was the _understanding_ and the machine can't do that for you. What does it mean if we get "super powered alien maths" but humans can't do it? It's like inter univeral teichmuller theory but imagine if Mochizuki was right and it came with a lean proof?
In my view, over the last century, math has turned into an intellectual analogue of extreme bodybuilding competitions. A navel gazing runaway optimization in making useless stuff just to demonstrate cleverness. That's fine, why not. But society has no obligation to fund that, just as it doesn't fund other extreme hobbies. Ideally if we ever get something like UBI, math can be still their hobby.
Without human understanding you also might literally have no words for the thing you would otherwise want to ask for.
I think it'll be wildy useful but I also suspect human competence will still matter.
So make mathematicians proudly wear their flag colors and sing the anthem while lecturing to cheering spectators. Might work.
Maybe AI will take over some roles of doctors, but that's independent of curing diseases. Think about diseases that have a cure - do people with those diseases not go see a doctor?