Actually, this is a great philosophical question. Mathematics is like a religion. Though it appears to be a very precise and concrete subject with many proofs to support with, for example like the Pythagoras’s theorem to support the a relation in Euclidean geometry among the three sides of a right triangle, it is not always how it seems. We never know whether the so called proof is correct. What if one day somebody simply proved this theory wrong? There could be many fallacies behind.
Generally, there are two streams of people who believe in different sides of mathematics. One believes that there are universal principles that just "are" and what we as humans are doing are to discover them one by one. And obviously the other one believes that mathematics is invented. Actually, personally I think there is no definite answer for this question. The answer is uncertain because mathematics is genuinely being discovered and also invented. Back to the very basic, mathematics itself did not exist before there was somebody who literally studied mathematics, who worked on mathematics etc. it is us, human being who grouped the concepts such as quantity, structure, space, and change into mathematics. Therefore, we can say that we invented the subject mathematics. However, concepts such as quantity,