With a PoW that has "external rewards", the cost of attacking the chain falls in proportion to the external reward. You are correct that it does not fall to zero.
No individual would pay for it, but it’s still more valuable than random noise.
Now one can argue that mathematical patents provide more costs than benefits, which is a line of debate I am certainly open to. End that, and math research would be a public good.
But in the system we have now, a huge amount of mathematical research has generated a significant amount of money for very many people, from the RSA algorithm to Penrose patenting his tilings (and getting money from toilet paper makers that used his aperiodic tilings to make their TP more fluffy [1])
What I think you mean to say is that the market consistently undervalues mathematical research. Unfortunately it's not so easy to actually demonstrate, because given the huge amount of math research produced, only a very small amount of that ends up being useful in the future and often the original discoverer is long dead. This is similar to the situation with other arts and sciences. A small number of people drive the field forward and the vast majority of scientific publications are basically filler. Certainly the world would be better with more effective funding mechanisms that we have on offer, which is basically a game of capture-the-grant.
[1]https://apnews.com/article/59354892d1875c277c91afd3fb5ca516
It proves it because with the selected algorithm, there's no known shortcut to just doing a load of hashes, so if you found one it means you did a lot of hashing.
What problem would you insert instead that had the same properties?
We should also not forget that it gets harder and harder for the same benefit. Any amount of energy can be poured into a PoW system. Invent fusion, use it all in crypto.
The problem then is more economics, who has an incentive to discover more Mersenne primes?