# Does anybody know the history of how Peter Gustav Lejeune Dirichlet came up with the “nowhere continuous” Dirichlet function?

So I am writing a research paper on the properties of the Dirichlet function (the function with 1 if x is rational and 0 if x is irrational), and I wanted to include some historical background on how Dirichlet came up with this function. However, I have found next to nothing about how he came up with this function. All I have found are what the function is and how you prove it, and other applications. But I want to include something on the historical developments of the Dirichlet function for my research paper.

Do anybody know of the historical background to the Dirichlet function? And if so, what resource are you getting this information from?

It would remain for us to consider the case where the suppositions we have made upon the number of breaks of continuity and upon that of the maxima and minima values cease to hold. (...) One would have an example of a function which does not satisfy (them), if we supposed $$\phi(x)$$ equal to a fixed constant $$c$$ when the variable $$x$$ assumes a rational value, and equal to another constant $$d$$ when this variable is irrational. The function thus defined has finite and determinate values for any value of $$x$$, and yet one cannot substitute it in the series, as the different integrals which occur in this series lose any significance in this case.