This question has sparked debate for centuries, but the answer depends on what you mean by math.
If by math you mean the patterns, structures, and relationships built into the Material World, then math was discovered. Those patterns existed before anyone noticed them, named them, or wrote them down. Two rocks and two shells made four long before humans created numerals or equations.
But if by math you mean the symbols, notation, and systems of thought used to describe those patterns, then math was invented. Numbers, formulas, proofs, and equations belong to the realm of ideas. They are not the world itself, but mental constructs used to describe and organize what minds encounter in the world.
This fits well with the Idea of Ideas explored in chapter 18 of 30 Philosophers. In some ways, it resembles Kant’s Transcendental Idealism in that both recognize a distinction between the world itself and our experience or description of it. But the Idea of Ideas is framed more pragmatically through TST’s split between the Material World and Ideas about it. It then goes a step further by sorting ideas into empirical and rational ideas, into direct and indirect descriptions. In that way, it loosely echoes Hume’s Fork, which also tried to separate stronger ideas from weaker ones by asking how well they connect to experience and reason.
Math, by this view, is part of the world of ideas, but it is a special kind of idea. It is a rational system minds develop to describe patterns and relations that are genuinely present in the Material World. In a very real sense, math was both discovered and invented. The underlying structures and relations were there to be discovered. The language and symbolic systems used to describe them were invented.