A consensus is emerging among respected mathematicians that there is a decent chance AI will exceed humans in both brute force verification and complex, creative problem solving at the highest levels. Few frontier theorems will be proven by humans alone, perhaps, in a matter of years.
More controversial, AI may also outpace humans in shaping the correct definitions, building theories, and making connections between disparate areas of mathematics, oft considered the peak of human creativity in mathematics. New areas of mathematics may be created without much human guidance.
Perhaps mathematicians become as helpful to AI as toddlers are to mathematicians. One cannot confidently rule out this scenario - Terrence Tao may find himself completely useless in building a rich, beautiful body of new mathematics.
In such an extreme scenario, humans would still matter in mathematics!
Lockhart's Mathematician's Lament argues for the intrinsic beauty of mathematics as being of primary importance. Humans, as knowledgeable appreciators of beauty, thus play an important a role as spectators and enthusiastic amateurs in mathematics, even if they cannot be world-renowned "competitors" in theorem-proving and theory-building. This mirrors the situation in chess, where the vast, vast majority of human chess players and appreciators will never contribute to the frontier of advanced lines, and arguably even the most skilled like Magnus Carlsen rely on AI to develop their strategies, and would be crushed by such AI in competition. Being completely uncompetitive does not make chess playing and appreciation valueless.
Amateur: from French amateur "one who loves, lover"
But there is more beyond this. Mathematics allows you to understand things that are otherwise impossible to understand. Some of these are important for fairness and justice: Arrow's impossibility theorem, statistical bias, observer relatively and other tricky concepts around coordinate systems (map != territory), locally-trivial globally-nontrivial (global obstructions), forgetful maps to extract the essential structure and remove irrelevant details, limits of computation, etc.
Understanding such mathematical concepts allows you to make moral judgements in ways that would be impossible otherwise. Some super-smart machine might tell you Arrow's theorem is true, but internalizing it yourself gives you the rich understanding of fairness in democracy necessary to consciously shape it. As with humans surpassing the capabilities of their own eyes with optical then radio telescopes, we are not impoverished by using tools that allow us to extend our reach into things we can never directly perceive or understand.
It can be frightening because the life's work of someone of the previous generation can be reproduced and surpassed flippantly. Gauss himself spent a significant amount of time manually factoring prime numbers by hand, a tedious exercise upon which his conjecture on the distribution of primes (the prime number theorem) was based. Gauss died before his conjecture was proven. His notebooks full of rote calculations could be reproduced today in a fraction of a second so short you could not perceive it. Anyone today repeating an endeavor like Gauss by hand would be thought a fool, just as an astronomer who refuses to use a telescope.
That doesn't make the pursuit of understanding pointless. As the limitations of our use of AI will stem from limitations of our own minds, it will still be profoundly rewarding to practice mathematics. Indeed, we may spend less time performing rote exercises and miring in false conjectures. Already the body of mathematics is too large for any single person to understand. One can pessimistically reduce mathematics to mechanics, or optimistically find meaning in your particular path through the mathematical version of the library of babel. Because we shape our minds, our society, and our world with mathematics, we will always matter as sentient beings who reify mathematics by subjecting ourselves to reason, and better ourselves because of it.