How does one justify funding for mathematics research? G. H. Hardy's A Mathematician's Apology provides an answer as to why one would do mathematics, but I'm unable to find an answer as to why mathematics deserves public funding. Mathematics can be beautiful, but unlike music, visual art or literature, much of the beauty, particularly at a higher level, is only available to the initiated. And while many great scientific advances have been built on mathematical discoveries, many mathematicians make no pretense of caring about any practical use their work may have. So when the taxpayer or a private organization provides grants for mathematical research, what are they expecting to get in return?
I'm asking not just so I can write more honest research proposals, or in case it comes up in an argument, but so I have an answer for myself.
 A: I will suggest a "proof by contradiction" here.
First, let us make a very quick (and poor) statistical analysis on the amount spent on Mathematics research. Let us say that the research agencies spend 2% of money on mathematics*. Excluding the other basic sciences, this means that more than 90% of research is being spent on "helping deactivating a gene that kills hundreds of people" (to quote some comment above). Of these 2%, a small portion produce more applied results, that maybe will be used in high-standard technology in a soon future. The other portion provides comprehension of a very specific field, helping bulding an environment for eventual disruptive breakthroughs ("on the shoulder of giants", right?). 
Hence, as an investor, I would have no doubt in putting 2% of my money in mathematics. In return, I get some quick and applicable results that may lead to patents or products - (e.g. statistical models, industrial operations research models, etc). Eventually I get big breakthroughs with various applications, which come with the bonus of helping improving human comprehension of the world's very basic and profound questions (e.g. Complexity Theory, Population Dynamics, Information Theory).
Of course I could take the 2% of pure research and redirect it to more applied research. But, is it worth it? Is it worth NOT funding mathematics and loosing all the potential advances of science? And here is, as promised, the "proof by contradiction". NOT funding mathematics is dangerous, and may block very profound advances. Ergo, agencies should give money to research in mathematics.
Furthermore, although I am an applied mathematician, I completely disagree that you would get more "useful" results in redirecting all the efforts to the problems that come from real world applications (medicine, engineer, etc..). This can give you quicker results. This probably can help you downloading a video 1.3x faster. This probably can help a doctor with a better MRI equipment. Nevertheless, the real breakthroughs occur when one investigates more profound questions.
*Here in Brazil 2% is a very good approximation for the percentage of math scholarships, in comparison to scholarships granted to all areas. If anyone has more accurate information on the US agencies (for example, this NSF link is useful), I would be happy to know.
A: Benson Farb answered this beautifully in his University of Chicago commencement address. Here is an excerpt:

Since I am a pure mathematician, Dean Hefley suggested as a possible
  topic for this talk: “Why the square root of negative 1 is necessary”.
  I could take up this challenge of justifying pure science on its vast
  applicability; indeed the square root of negative 1, the basic
  “imaginary number”, underlies a huge swath of modern technology, from
  the design of circuits, airplanes and skyscrapers, to the construction
  of economic and financial models, to robotics. I have decided,
  however, to take the opposite point of view. I want to defend the
  value of basic science for its own sake...
...the purpose of pure mathematics, of basic
  science, is not the quick harvest. It is nothing less than an attempt
  to bring human thought and understanding to a higher level. It is an
  attempt to change not just what we think about the world, but how we
  think about it. The importance of this for human evolution is
  incalculable. As British physicist JJ Thomson said: “Research in
  applied science leads to reforms, research in pure science leads to
  revolutions.”
Benson Farb, 2012

A: It's a very good question, and it takes a brave and honest man to ask it.
Personally, I think that public funding of pure mathematics research is pretty hard to justify. 
I think all the arguments about possible future applications are weak, at best. Certainly you'd be more likely to get results that are useful in engineering or medicine if you worked directly in these fields themselves, rather than in pure mathematics. 
You can point to pure mathematics developed in past centuries that found applications in modern times, but this is the exception, rather than the rule, I think. And my impression is that mathematics is much more abstract today than it was in the past, so applications are even less likely.
It seems to me that many people choose to study mathematics because it's beautiful and enjoyable. So, in a sense, they treat it as an art form. It's an art form that can be appreciated only by a tiny fraction of the population, but the same is true of avant-garde jazz and some other art forms. And, lack of appreciation by the masses (arguably) does not diminish the art. But these are reasons for doing mathematics, not reasons for funding it. Public money ought to be spent on things that somehow improve and enrich our lives. The arts are funded for this reason, presumably, and one could perhaps use the same reasoning to justify funding for pure mathematics. But the amount would be small, I suspect.
In my day job, I do mathematics that solves problems in engineering and manufacturing. I get paid a lot of money for this. In my play time, I do mathematics because it's fun and I find beauty in it. But I don't expect to get paid for this playing. And I don't want my tax dollars to pay for other people's mathematical play, either.
A: The Mathematicians Apology's author is a great argument for why pure mathematics is "useful".
Hardy argued that pure mathematics was worth doing for its own sake.  Hardy's particular category of pure mathematics was number theory, a kind of mathematics so removed from the practical world that it is now the foundation for the world's electronic commerce.
Billions of dollars spent every year, protected by our knowledge of Number Theory.
Category Theory, a system of abstracting mathematical structures so we do not have to talk about "concrete" things like fields and other (abstract to anyone else) mathematical structures when doing proofs has now inspired entire new programming techniques in Haskell, and from that it is diffusing into other corners of the information revolution.
Group theory, the abstract study of the "simplest" algebraic structure, is heavily mined by theoretical physics.  The last great revolution in theoretical physics resulted in nuclear power and bombs.  There may be surprising yields in fundamental physics yet unseen, and study of E8 and similar groups was long a pure mathematical endeavour.
Mathematics is unreasonably effective at describing the world.  Even the purest corners of mathematics end up running into applications.  Yes, the payoff may not be immediate, but that does not mean the payoff won't be large.
A: A mordant response from Bertrand Russell, Human Society in Ethics
and Politics (Simon and Schuster, New York, 1955), 43:

In universities, mathematics is taught mainly to men who are going to teach mathematics to men who are going to teach mathematics to ...   Sometimes, it is true, there is an escape from this treadmill.   Archimedes used mathematics to kill Romans, Galileo to improve the Grand Duke of Tuscany’s artillery, modern physicists (grown more ambitious) to exterminate the human race.   It is usually on this account that the study of mathematics is commended to the general public as worthy of State support.

A: Like any other area of basic (i.e., non-applied) science, mathematics may not appear to have any use. However, there's no telling where some bit of basic "pure" research will lead to. What if research on Quantum Mechanics (a useless and esoteric playground for underutilized physicists if I ever heard of one) had not been funded in any way in the 1920s - 1940s? We likely would not have the transistor and all the improvements (such as affordable computing power) that flow from that. Likewise, some areas of pure mathematics that may seem like a waste of funding (to the William Proxmires among us) may turn out later to have great value, such as in the applied fields of communications theory and cryptography. In short, there's no telling when basic research could lead to applied benefits that no one could have dreamed of, very often returning the investment manyfold. 
Applied research usually only leads to near-term improvements in products and methods (think: improving photolithography by moving from visible light to ultraviolet). It takes basic (pure) research to open up new fields (think: QM leading to transistors, leading to computer chips). Mathematics is no different. Who knows what obscure corner of math will yield something of great applied importance?
A: Abraham Flexner, founding Director of the Institute for Advanced Study, wrote an essay, The Usefulness of Useless Knowledge, for Harper’s magazine in 1939. Princeton University Press has now published a book of the same title, with Flexner's essay and a new companion essay by Robbert Dijkgraaf, Director and Leon Levy Professor at the Institute. 
The Flexner essay, although not restricted to Mathematics, can be read as an answer to the question posed here. I haven't read the Dijkgraaf essay. 
Flexner's essay is freely available online. Here's a link to the Princeton University Press page for the new book. 
A: As a respite from boredom. (Certainly as acceptable as professional sports--more so in my book.)
I'm half serious. Certainly many people do math and other activities for recreation, but more importantly boredom as an evolutionary strategy stops us from spending too much of our resources on one activity and motivates us to pursue other activities that are or may become important for our present or future well-being and even survival whether we are aware of that or not. Some speculate that it was homo sapiens sapiens' (twice wise man) superior innate curiosity and imagination that allowed us to survive while Neanderthals became extinct. It is the ensuing eclecticism that allows us to adapt and survive in an ever changing somewhat unpredictable world. Of course, one is still left with the dilemma of how to rationally allocate available resources, but it is clear from the progress emerging from the synergism  between the sciences and technology and mathematics that exploratory math plays an important role in expanding these resources. Drives (productive or not as the circumstances dictate) generally trump principles, and we should foster the productive ones in the appropriate situations just as we foster the play of our children not just for our own and their pleasure but also for developing skill sets, knowledge, and other attributes important for their future prosperity and happiness. Thanks to evolution the pragmatic and pleasurable are often entwined, frequently with unforeseen, wonderful consequences.
There's also the issue of assessing the importance/value of work. Often this is linked to the amount of money that one can make performing the work. Celelebrites, high-tech entrepreneurs, doctors, ... are part of machines geared to generate tremendous wealth for those in the spotlight and those who can manipulate the machines--witness the contest between Tesla and Marconi on patents important in the development of radio; one died a pauper, the other, a rich man. Typically physicists and mathematicians have lower salaries than engineers although, as in the case of Heaviside, who also died a poor man, engineers benefit from the theoretical work. Essentially, the closer you are to the money, the more you make--it's SOP in gov't research centers to jump to the management ladder to increase one's pay and stay ahead of the inflated costs of housing, education, health care, insurance, etc. in America these days. (Another important case: grad assistant vs. prof, eh?)
A: Have a look at our Knot Exhibition, which aims to explain how mathematics gets into knots. It explains some of the methods used: representation, classification, invariants, analogies, laws and applications.  The applications come after one has developed the necessary concepts and methods, and may also be motivated by such potential applications. 
Mathematics develops rigorous language for expression, proof, analogy, verification, falsification, calculation. As an example, the language of abstract group theory was developed by many pure mathematicians, and was found necessary to determine all the 230 crystallographic groups, and also to develop the theory of quarks. 
The abstract language of mathematics is really about analogy. Much modern pure mathematics is about describing abstract structures,  relating them, often via category theory, and the difficult task of describing their interaction. For this, numbers are not enough. 
A: For me, I can’t. I need a pencil and a quiet spot. I’ve applied for grants but never had any idea why, apart from institutional pressure. 
A: Since this question has popped up to the front page, and at the risk of interpreting it over-broadly, I think it is worth reproducing a famous quote by Carl Gustav Jacob Jacobi in a letter to Legendre dated 2 July 1830:

Il est vrai que M. Fourier avait l'opinion que le but principal des mathématiques était l'utilité publique et l'explication des phénomènes naturels ; mais un philosophe comme lui aurait dû savoir que le but unique de la science, c'est l'honneur de l'esprit humain, et que sous ce titre, une question de nombres vaut autant qu'une question du système du monde.

(Carl Gustav Jacob Jacobi, Gesammelte Werke, band 1, Reiner,
Berlin 1881, Correspondance mathématique avec Legenre, 454–455, scan here.)
Translation from Wikiquote (ever-so-slightly edited):

It is true that Mr Fourier had the opinion that the principal end of mathematics was the public utility and the explanation of natural phenomena; but such a philosopher as he is should have known that the unique end of science is the honor of the human mind, and that from this point of view a question of numbers is as important as a question of the system of the world.

The reference to the "honor of the human mind" was used, in particular, by Dieudonné for the title of his book, Pour l'honneur de l'esprit humain (Les Mathématiques d'aujourd'hui) (1987).
A: As a mathematician I go along with the classical Jacobi-Poincaré line exemplified by Farb's 

...the purpose of pure mathematics, of basic science, is not the quick harvest. It is nothing less than an attempt to bring human thought and understanding to a higher level. 

However, I think that this is a dead end in justifying the public support of mathematics. In a world where people still starve and lack basic needs (and this is true of  some sections of the population of "rich" countries as well), I don't think that exaltation of the human spirit will get us very far. A better strategy is perhaps to compile a very long list of all the scientific and technical progress that mathematics has stimulated. Tomography and Radon transforms, Fourier analysis and circuit theory, etc. Coarsely speaking, if people become convinced that without mathematics they would not have an iPad, then we do not need to fear for our funding.
Another good question is how much funding does mathematics REALLY need and how to use it most effectively. The current trend of mega-grants to a selected few (who are then burdened by their management) to the detriment of institutional funding does not seem to me to be the best way to go about funding mathematics.
A: One has to note that in many countries there is a ministry that combines art and science. Clearly, society has decided that pure science research should be funded using taxpayer's money for similar reasons why art is funded. But funding research is only one way of promoting it. Another task of the government is to make sure that the public is educated well enough to be able to enjoy and benefit from the results of the research. Here most countries treat science and art differently. The educational program is quite minimalistic as far as science and math is concerned, you only learn what you need to know to get a job. If you want to learn more you need to study at university. We don't take this attitude when it comes to art or literature.
This difference in attitude toward art and science explains why the beauty of math isn't as easily accessible to the wider public compared to the beauty of literature. But beyond not being able to appreciate the beauty of the subject, this has negative consequences for society. How can a democratic society choose what it should do to curb climate change if most people don't have enough scientific skills to separate expert opinion from nonsense? So, perhaps we are now paying the price of not having taken math as serious as other subjects. 
A: Classic question on the lines of "someone should do something", and easily incorrectly answered by an argument of why the respondent would do something.
The question is about a "taxpayer or a private organization ". The latter is vague; it could be just because the private organisation is a foundation chartered to fund mathematics.
But, if by "taxpayer", we really mean a government, I will assume to start with that we mean government of a rich country.
Let's look at a few different departments:


*

*Science, let's ask Roger Bacon:



"“If in other sciences we should arrive at certainty without doubt and
  truth without error, it behooves us to place the foundations of
  knowledge in mathematics.”

This has been true throughout the history of science and remains true today; genetics is pushed forward by mathematicians who may not have originally commenced their career in that area at all.


*

*Industry


The modern information economy is based on technologies whose key founders such as Turing and von Neumann were mathematicians. In the first instance their research (prior to the war, see below) would surely be classed as pure rather than applied. In addition of course, countless areas have made use of applied maths.


*

*Arts


As covered elsewhere, mathematical truth is beauty.


*

*Defence/Defense/War or however referred to in the said country.


Maths had a major role in WW2 in both code breaking and in the modelling supporting the Manhattan project, as well as many other areas. In the future, code breaking is even more important as it underpins more and more of our infrastructure. In the US, how does the NSA's budget compare to federal funding of mathematics? To misquote Dr Strangelove, can any country really afford a "maths gap"?


*

*Finance/ Treasury/ Economics


Well maybe most Western governments could use a few more mathematicians there?
A: From the politicians point of view, there could have the following aspect (I'm not too much happy with):   
It could be important for the politicians to maintain a corps of people trained to intensive thinking (by solving any new mathematic problem), as an insurance in the case of a new major conflict (or any unforeseen problem). In fact, such people were useful during wars, see for example the recent biopic of Alan Turing during WW2.    
A: A century old opinion: http://www.jstor.org/stable/2972761 (The Significance of Mathematics, by E. R. Hedrick)

Shall we not search our own house? Shall we not ask if our own collegiate and
  graduate courses in mathematics demonstrate to students the real significance
  of the theory they cover? Have we denatured each subject until insight is
  eliminated and only formalism and logical tricks remain? So long as this blight
  remains, we must expect and we shall deserve public disdain and sincere doubt
  of our value to humanity

and the modern one: https://www.dpmms.cam.ac.uk/~wtg10/importance.pdf (The Importance of Mathematics, by W. T. Gowers)

I don’t think this philosophical question has been satisfactorily answered, but we can be grateful that in our world it is possible to use simple mathematical models. These can describe, or even explain, the great complexities of physics and to a lesser extent the other sciences. Once again, complexity arises from simplicity, and, once again, beauty reveals itself to be important. Thanks to this piece of good fortune, we can be conﬁdent that
  mathematicians, if they are given the freedom to pursue the subject that gives them so much pleasure, will continue to produce a body of work that is important in every sense of the word.

A: What a good question! My attempt at an answer in one line is that I think that a lot of fields that we consider very important were off shoots of mathematics at some point in the past. 
If one goes far enough back I don't think there were many "mathematicians" as we label them today. I think people were "natural scientists" and mathematics was a powerful tool that they developed for either its own sake or for use in their other studies. 
As we gained more knowledge and things became more specialized then things started to branch off. For example, I think you would be hard-pressed to find a pure "physicist" or a pure "mathematician" pre 1940s. They did exist, but the two fields of study were much more entwined. With the rise of industrial physics due to the war we commercialized physics and created physics departments (again, they may have existed in the past but not as they do today). 
Another more recent example is computer science. A lot of computer science theory was (and still is) developed in mathematics departments. The creation of new computer science programs and departments is a relatively new thing and is again the commercialization of a mathematics off shoot.
I think it would have been near impossible to have predicted the commercialization of physics or computer science in the 1800s, just as it is near impossible for us to predict what will come of it now. If the past is any predictor of the future, though, there are going to be fields of study that don't necessarily exist today that may be born out of mathematical research.
A: Mathematicians are constantly in the habit not just of determining mathematical truths, but continually rewriting their results, getting at the right level of generality, developing useful notations, absorbing theory into well-chosen definitions, etc. Over time this continuing process makes mathematics evolve into particularly usable and general forms for future generations of mathematicians and other scientists to pick up, understand, and readily use (cf. "unreasoable effectiveness"). Examples might include the language of differential forms and tensor calculus, the theory of connections and fiber bundles, and the use of string diagrams and circuit diagrams à la Penrose, Joyal-Street, and being pushed into new directions and applications by John Baez and his coworkers (control theory, electrical circuits, chemical reaction networks, etc.). 
Jean-Yves Girard said somewhere (perhaps in Proofs and Types) that computer science is the great consumer of mathematical logic; flexible and general forms of logical languages have huge potential pay-offs in the design of flexible and efficient programs and programming languages. In short, mathematicians are in the business of getting the language right, and the resultant economy of thought gradually but inevitably works its way into the language of other sciences. 
A: This is not meant to be a fully convincing answer, but to argue for one possible way that pure mathematics research is important.  I believe that mathematics has some special features that make it good for promoting international cooperation and friendship, building bonds between diverse peoples.
First, as is clear to us who do it, pure mathematics is interesting all on its own.  One manifestation of this is that it doesn't seem to depend on cultural background or political ideology whether the ideas in mathematics are found to be interesting by a sufficiently curious mind.  The same ideas can be appreciated regardless of one's overall perspective.
Second, mathematics is (pretty much) objective.  One can recognize the value of a mathematician's contribution, and if one has the bare minimum of honesty, it will trump all other prejudgements about the other party.  In this way, it has the ability to break through prejudice or adversarial political commitments, without first requiring subjective emotional change to get started.
Third, mathematics only requires time and thought.  In modern times, once mathematicians with close interests are introduced, collaboration can begin easily and will not necessarily require costly investments by governments or others to get going, in contrast to experimental science.
Of course, all the pure intellectual pursuits of mankind are valuable in themselves.  But mathematics, though practiced by a small number of us, seems to have a special ability to transcend cultural barriers and perhaps thus contribute in some small way to peace.
A: Just one assumption: if a private organization provides grants for mathematical research, presumably it admits that mathematical research by itself does make sense.
This granted, if you manage to explain how results of your research might be useful for some other researchers (either in mathematics or in any other area that the organization under consideration might find equally sensible) whose results in turn would not be entirely isolated from the outside world, then this should suffice for justification.
There can be of course cases when grants are provided under certain conditions, to investigate this and that particular problem. But then trivially either you do not have anything to do with it or you show evidence that your previous experience gives you chance to tackle this particular problem, and do not need any further justification either.
A: One should ask "How does one justify funding?".  If the money is spent or donated voluntarily for research or anything else for that matter, there is nothing to justify.
If the money is acquired from people involuntarily, then you must make the presumption that what is being funded is a better way to spend the money than the people the money was acquired from would have spent it.  However, if you are satisfied with such a justification, then you don't have much room to complain if someone thinks they know how to spend your money better than you do and spend it on something that you don't agree with.
Overall, it would be far better to promote the opportunity and desire for private funding.
