Math was first discovered in the form of accounting. It could be said that simple math (1 dead deer vs. 2 dead deer) could date back to the stone age, but actual written math dated to about 2000 to 3300 B.C. when tax accounting started.
Math was discovered the first time anyone took two objects and made up a name for this situation, such as "two". Math is simply that language used to describe that aspect of reality.