If $r+\frac{1}{r}$ is an odd integer then $r$ is irrational [duplicate]

Suppose that there is a real number $r$ such that $r+\frac{1}{r}$ is an odd integer.Then $r$ is irrational.

Let $r\in \Bbb Q$ then $r=\dfrac{p}{q}\implies \dfrac{p}{q}+\dfrac{q}{p}=$odd

$\implies \dfrac{p^2+q^2}{pq}$ is odd integer.

Since $r+\frac{1}{r}$ is an odd integer$\implies pq\mid p^2+q^2$

How to derive a contradiction from here?

marked as duplicate by Bill Dubuque abstract-algebra StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Sep 29 '17 at 14:42

• $p$ and $q$ have no common factor (co-primes). – Ahmad Sep 29 '17 at 14:07
• People answering this question should note that it does not specify that the real numbers or rationals or integers involved are positive. – Mark Bennet Sep 29 '17 at 14:23

You should have stated that $\frac pq$ is in lowest terms. $pq|p^2+q^2$ implies that $p$ divides $q$ and that $q$ divides $p$.
• Does this use the oddness of $r+\frac{1}{r}$ or just that it is not $2$ with $r=1$? – Henry Sep 29 '17 at 14:09
• @Henry It implies $p=q$, hence $r=1$ and $r+1/r=2$, which contradicts oddness. – Aaron Sep 29 '17 at 14:10
• @Henry It is not using oddness at all, but divisibility properties of the integers. You should note that $r=-1$ is another possibility. The conclusion is that no odd integers are possible for rational $r$. Neither are most of the even integers. – Mark Bennet Sep 29 '17 at 14:21
We may assume $\gcd(p,q)=1$. Then $p|pq$ and $pq|p^2+q^2$ implies $p|p^2+q^2$ and subsequently, since $p|p^2$, $p|q^2$. Since $p|q^2$ and $p|p^2$, we know $p|\gcd(p^2,q^2)=\gcd(p,q)^2=1$. Thus $p=1$. Then we have $\frac{p^2+q^2}{pq}=\frac{1+q^2}{q}$. Since $q|q^2$ and $q|1+q^2$, we arrive at $q|1\rightarrow q=1$. Then $r=\frac{p}{q}=1$, but $1+\frac{1}{1}$ is not an odd integer.
We have $$\frac{{p^{\,2} + q^{\,2} }}{{pq}} = \frac{{\left( {p + q} \right)^{\,2} - 2pq}}{{pq}} = \frac{{\left( {p + q} \right)^{\,2} }}{{pq}} - 2$$
so $$\frac{{\left( {p + q} \right)^{\,2} }}{{pq}} = n\quad \Rightarrow \quad \left( {p + q} \right)^{\,2} - n\,pq = 0$$ and the parity table tells you that n cannot be odd $$\begin{array}{c|lcr} {p\backslash q} & & {\rm o} & {\rm e} \\ \hline {\rm o} & & {n\,{\rm even}} & \emptyset \\ {\rm e} & & \emptyset & {n\,{\rm even}} \\ \end{array}$$