<s>[INST] Why does this function only have 3 rational solution? Why does the function $f(x,y) = x^3 - x - y^2$ only have the three rational roots
$(0,0)$, $(1,0)$, $(-1,0)$?
 [/INST] We have $f(x,y)=x^3-x-y^2$. We define a pair of roots $(x,y)$ to satisfy $f(x,y)=0$. Then:
$$x^3-x=y^2$$
Thus, we are looking for rational solutions for the above equation. Let $x=\frac{m}{n}$ where $\gcd(m,n)=1$ and $n>0$. Assume $y^2 > 0$.
$$x^3-x=x(x^2-1)=x(x-1)(x+1)=\frac{m(m-n)(m+n)}{n}=y^2$$
We have the numbers $m-n$, $m+n$, $m$ and $n$ to be pairwise relatively prime since $\gcd(m,n)=1$. This shows that:
$$\frac{m(m-n)(m+n)}{n}=y^2 \implies (m-n,m+n,m,n) \text{ are of the form } k^2\text{ or }-k^2$$
where $k$ is an integer. All of these values cannot be positive by Fermat's Right Triangle Theorem. We know that $n$ is positive. If $m+n$ is negative, then $m$ has to be negative and since $m>m-n$, $m-n$ will also be negative. This will be a contradiction since we will get:
$$0>\frac{m(m-n)(m+n)}{n}=y^2$$
as there are three negatives in the numerator. Let $m+n$ to be positive. As we know that $m$ and $m-n$ cannot be both positive and $y^2 \geqslant 0$, we need both $m$ and $m-n$ to be negative. Then, $n-m$ and $-m$ are positive. We have:
$$y^2=\frac{m(m-n)(m+n)}{n}=\frac{(-m)(n-m)(n+m)}{n}=\frac{(n)(n-m)(n+m)}{-m} \cdot \frac{m^2}{n^2}$$
$$\bigg(\frac{yn}{m}\bigg)^2=\frac{(n)(n-m)(n+m)}{-m}$$
which is again a contradiction by Fermat's Right Triangle Theorem.
We must thus have $y^2=0$. This means $x^3-x=0$ whose only roots (which are all rational) are $-1$, $0$ and $1$, proving the necessary.
</s>