<s>[INST] Let $x$,$y$ be rationals such that $\frac{x^2+x+\sqrt{2}}{y^2+y+\sqrt{2}}$ is also rational, prove that either =, or +=−1. I followed one convincing proof in this related post but I don't understand the assumption and conclusion.
The proof goes as follows:

Let $r\in\mathbb{Q}$ such that
$\frac{x²+x+\sqrt{2}}{y²+y+\sqrt{2}}=r$ and suppose that $\frac{x}{y}$ is a irreducible fraction. Then
$$\frac{x²+x+\sqrt{2}}{y²+y+\sqrt{2}}=r\Leftrightarrow
> x²+x+\sqrt{2}=(y²+y+\sqrt{2})r\Leftrightarrow
> x²+x-y²r-yr=\sqrt{2}(r-1).$$ If $r\neq 1$ we have
$\sqrt{2}=\frac{x²+x-y²r-yr}{r-1}\in\mathbb{Q}$, but this is absurd.
So we get $r=1$ and $$x²+x+\sqrt{2}=y²+y+\sqrt{2}\Rightarrow
> y(y+1)=x(x+1).$$ If $x=-1$, we have $y(y+1)=0$ and so $y=0=x+1$ or
$y=x=-1$. If $x\neq -1$ we have $$x=y(\frac{y+1}{x+1}).$$ If $y=-1$,
it is analogous. We can suppose that $y\neq -1$. If $y=0$, $x=0$.
Suppose $-1\neq y\neq 0$. We have $$\frac{x}{y}=\frac{y+1}{x+1}.
$$Since $\frac{x}{y}$ is irreducible, follows the last equality that $x=y$.

I have two questions:

*

*Is it valid to suppose that $\frac{x}{y}$ is an irreducible fraction? Wouldn't that ignore other values?

*How assuming $\frac{x}{y}$ is irreductible follows that $x$=$y$ for  $\frac{x}{y}=\frac{y+1}{x+1}$?

I am particularly interested in the first question as it conflicts with my developing rigour in Mathematics.
 [/INST] No, it's not allowed to even consider $x$ and $y$ integers.
When you arrive at
$$
x(x+1)=y(y+1)
$$
you're almost done, because this can be rewritten as
$$
x^2-y^2+x-y=0
$$
hence
$$
(x-y)(x+y+1)=0
$$
</s>