There is no doubt that both God and Mathematics are extremely useful for humankind. God helps us cope with death, illness and moral discipline while mathematics is indispensable for computation and for scientific analysis. That is why all human societies always end-up using both.
However, a different issue is whether there is a transcendent god or mathematics, independent of human thought. If that is the case then they may be classified as discoverable. Otherwise they are invented by the human brain.
The recent extraordinary developments in the science of the mind might soon lead to uncover the way learning and memory are processed in the brain. Once we reach that stage we may finally answer the discovery/invention question.
However, that will not be the end of speculation on some fundamental philosophical issues.
For instance, a comparative study of the origin of all religions may conclude that God was everywhere created on the image of his originators. Thus we could go on improving on the existing gods or to create new ones more adapted to our current needs. However, the idea that man created god and not the other way around undermines the basic power of religion which is based on the belief of life after death.
The problem of loss of credibility does not exist in the case of mathematics, but other equally interesting issues remain. For instance, assuming that mathematics is discovered and not invented means that there is a finite body of mathematical knowledge? On the contrary, if it is invented will other forms of intelligent life develop different types of mathematics which are specific to their brain?
Speculative propositions are an important tool of science. But the role of science is to validate or refute such hypothesis.