Mathematics is the language of science and has enabled mankind to make extraordinary technological advances. There is no question that the logic and order that underpins mathematics, has served us in describing the patterns and structure we find in nature.
Is Mathematics Invented Or Discovered?
I do not think we can provide a concrete answer to this question soon (or never will). However, I will try to give you some things to think about at least.
There is this idea of Mathematical Platonism:
Platonism about mathematics (or mathematical platonism) is the metaphysical view that there are abstract mathematical objects whose existence is independent of us and our language, thought, and practices
This idea argues that math is an independent entity from humans. Therefore, humans do not invent math. Humans realize and study math. The cited source makes clear that there are 3 conditions to be satisfied to prove mathematical platonism:
To prove existence condition, we can refer to the mathematical concept, such as number, equation, etc.
To prove abstractness condition, mathematics are merely concept. Thus, it does not have physical form. It only exists in a concept form. Therefore, it is abstract.
To prove independence condition, we do not know of how to prove this yet (or never will). To quote the best definition of Independence concept that I found
Mathematical objects are independent of intelligent agents and their language, thought, and practices.
Based on the definition, in order to prove this condition, we must somehow prove that mathematics presents regardless of the existence of humans, animals, or any other lifeforms that possess intelligence. I cannot find any convincing way to provide a solid proof. Perhaps, this is one of those questions that we may never be able to find an answer.
From a personal standpoint, one convincing concept really makes me believe in mathematical platonism is the golden ratio. It was discovered after Pythagoras tried to study proportion. This number is so phenomenal that it appears in nature (flower petals, pine cones, hurricane), space(shape of the spiral galaxy), etc. Based on the observation of appearance of this number, I believe math is discovered, not invented.