<s>[INST] What is the probability that a natural number is a sum of two squares? Some natural numbers can be expressed as a sum of two squares:
$$2=1^2+1^2$$
$$25=3^2+4^2$$
$$50=7^2+1^2$$
If one chooses a random natural number, what would be the probability that that number is a sum of two squares? Is it zero?
I read about Lagrange´s theorem on squares, but it looks it can´t be useful here.

NOTE 1: "Square" means "square of a natural number".
NOTE 2: I am aware that the expression "random natural number" is not a strict math notion. However, as I said in a comment, one can adopt a reasonable strict definition, which is not difficult to devise at all. It is mentioned also in an answer below.
NOTE 3: A related question on SE: How to determine whether a number can be written as a sum of two squares?
 [/INST] Consider the function $r: \mathbb{N} \to \mathbb{C}$:
$$
r(n) = \begin{cases}
1 &n \text{ is the sum of two squares (0 is a square)} \\
0 &\text{otherwise}.
\end{cases}
$$
One way to define the "probability that a random integer is the sum of two squares" would be to consider the distribution on the integers where $n$ selected with probability proportional to $n^x$, for $x > 1$, and then to take the limit as $x \to 1$. That is, we can try to compute:
$$
\lim_{x \to 1} \frac{\sum_{i=1}^\infty \frac{r(n)}{n^x}}{\sum_{i=1}^\infty \frac{1}{n^x}} \tag{1}.
$$
As mentioned here, $r(n)$ is $1$ iff every prime of the form $4k-1$ occurs an even number of times in $n$.
It follows that $r(n)$ is multiplicative, and
\begin{align*}
\frac{\sum_{i=1}^\infty \frac{r(n)}{n^x}}{\sum_{i=1}^\infty \frac{1}{n^x}}
&= \frac{\prod_{p \text{ prime}} \sum_{i=0}^\infty \frac{r(p^i)}{p^{ix}}}{\prod_{p \text{ prime}} \sum_{i=0}^\infty \frac{1}{p^{ix}}} \\
&= \prod_{p \text{ prime}} \frac{1 + \frac{r(p)}{p^x} + \frac{r(p^2)}{p^{2x}} + \cdots}{1 + \frac{1}{p^x} + \frac{1}{p^{2x}} + \cdots} \\
&= \prod_{p \equiv 3 \pmod{4}} \frac{1 + 0 + \frac{1}{p^{2x}} + 0 + \frac{1}{p^{4x}} + \cdots}{1 + \frac{1}{p^x} + \frac{1}{p^{2x}} + \cdots}
\prod_{p \equiv 1,2 \pmod{4}} \frac{1 + \frac{1}{p^x} + \frac{1}{p^{2x}} + \cdots}{1 + \frac{1}{p^x} + \frac{1}{p^{2x}} + \cdots} \\
&= \prod_{p \equiv 3 \pmod{4}} \frac{1 + \frac{1}{p^{2x}} + \frac{1}{p^{4x}} + \cdots}{1 + \frac{1}{p^x} + \frac{1}{p^{2x}} + \cdots} \\
&= \prod_{p \equiv 3 \pmod{4}} \frac{1 \big/ \left(1 - \tfrac{1}{p^{2x}}\right)}{1 \big/ \left(1 - \tfrac{1}{p^{x}}\right)} \\
&= \prod_{p \equiv 3 \pmod{4}} \frac{1}{1 + p^{-x}}. \\
\end{align*}
Now if you plug in $x = 1$, you get the product
$$
\prod_{p \equiv 3 \pmod{4}} \frac{p}{p + 1}
= \prod_{p \equiv 3 \pmod{4}} \left( 1 - \frac{1}{p + 1} \right)
= 0,
$$
by the reasoning of Hagen von Eitzen.
So by this definition of probability, the probability that a random integer is a sum of two squares is zero.
</s>