Proving that $x$ is irrational if $x-\lfloor x \rfloor + \frac1x - \left\lfloor \frac1x \right\rfloor = 1$

$x-\lfloor x\rfloor+{1\over x}-\lfloor {1\over x}\rfloor=1$ implies $x^2-kx+1=0$, where $k=\lfloor x\rfloor+\lfloor {1\over x}\rfloor+1$ is an integer. It does not matter that $k$ depends on $x$, the only possible rational solutions are $x=\pm1$.

But if $x=\pm 1$, then $x - \lfloor x \rfloor + \frac 1 x - \left\lfloor \frac{1}{x} \right\rfloor = 0$.


Suppose $x = 1$. Then $x - \lfloor x \rfloor + \frac 1 x - \lfloor \frac 1 x \rfloor = 0$.

Suppose $x = m/n$, $m,n \in \mathbb Z$. Without loss of generality, presume $x > 1$ so $m/n = m' + m''/n$ for some $m' \in \mathbb Z$, $0 < m'' < n$ and $1/x = n/m$.

So $x - \lfloor x \rfloor + \frac 1 x - \lfloor \frac 1 x \rfloor = m''/n + n/m = 1$ so $m''m + n^2 = nm$ so $(m - m'n)m +n^2 = nm$ so $m^2 - mn(m' + 1) - n^2 = 0$. The quadratic equation yields no integer solutions for $m$ or $n$.