Both
Most of the math we use today was a discovery by the Muslims and the Babylonians. Calculus was use to chart the stars by the Babylonians, but was then lost to history until Isaac Newton. Algebra was discovered and the numerals we use today were invented, by the Muslims. The 0 (zero) was a discovery from India.
I think that both are correct for the math subject it has been discovered and invented.
Is mathematics discovered or invented? Wrong question! The real question is, “Is invention discovery or creation”?