TITLE: Proving that $x$ is irrational if $x-\lfloor x \rfloor + \frac1x - \left\lfloor \frac1x \right\rfloor = 1$
QUESTION [5 upvotes]: Prove :
$$ \text{If } \; x-\lfloor x \rfloor + \frac{1}{x} - \left\lfloor \frac{1}{x} \right\rfloor = 1 \text{, then } x \text{ is irrational.}$$
I think the way to go here is to falsely assume that $x$ is rational, thus having $x=\frac mn$ with $m,n$ integers and go with that, we also know that $x$ with the celling belongs to the integers and that $\frac 1x$ with the celling gotta be a $0$. Still can't prove it.
Thank in advance !

REPLY [14 votes]: $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$.