My guess is that eventually AI has advantage over us in all aspects of mathematical research. But I think there are two possible worlds where this doesn't happen soonish:
(1) AI exceeds our capabilities in all measurable capabilities, but there are still some (very intangible) intangibles where humans have higher capabilities. In this world we see AI making huge numbers of amazing discoveries but for some weird reason humans sometimes also do so. This could happen if there are some skills that are useful for math research but very hard to measure or train for. I think this is unlikely but possible.
(2) Rather than AI exceeding humans in all capabilities, AI becomes more like *one* (or several) amazing mathematician(s). By which I mean, very technically strong but with a certain point of view, which makes them more likely to make certain discoveries than others. In this world humans are useful because of their greater cognitive diversity--they sometimes think of approaches/questions/ideas that don't occur to the AI. This happens now--there are mathematicians much stronger than I am but I'm still useful (plausibly for reasons other than comparative advantage) because I have some different points of view. I think this is closer to what the near-term trend looks like, but the medium-term is less clear.
In the (IMO more likely, in the medium-to-long term) world where AI does have absolute advantage over us in all aspects, I don't think research ends. Plausibly we have AI producing huge numbers of papers, asking all sorts of interesting questions, and so on. Probably these questions do not include all questions we might ask, so there's still some role where we ask questions (even if the models are better at this, me still might care about questions they haven't asked)!
And IMO the goal of science isn't just "papers," it also includes things like "understanding." Maybe the models have this in their weights or something, but I also want to understand stuff. So we have to extract this understanding from papers or model weights or w/ever. This might look more like hermeneutics than research currently does, but my experience is that trying to understand mathematics that someone else has produced is not actually so different from research. You end up doing a lot of work, developing your own intuition, and so on.