For any positive integer $n > 2$, the equation
$$x + {\small{\frac{1}{x}}} = n$$
has two positive real roots (the roots of $x^2 - nx + 1 = 0$), so without further restrctions on $x$, it's not true that for $x > 0$, the expression $x + {\large{\frac{1}{x}}}$ is an integer only if $x=1$.
But if you require $x$ to be a positive integer, with $x > 1$, then
$$x < x + {\small{\frac{1}{x}}} < x + 1$$
so $x + {\large{\frac{1}{x}}}$ is trapped between two consecutive integers, hence can't be an integer.
Next suppose $x$ is a positive rational number, with $x \ne 1$, such that
$x + {\large{\frac{1}{x}}}$ is a positive integer, equal to $n$, say.
\begin{align*}
\text{Then}\;\;&x + {\small{\frac{1}{x}}} = n\\[4pt]
\implies\;&x^2 + 1 = nx\\[4pt]
\implies\;&x^2 -nx + 1 = 0\\[4pt]
\end{align*}
but then, by the rational root test, $x$ must be an integer, which we already know is impossible (since $x > 0,\;x \ne 1$).
To recap:
- For $x > 0$, if you allow irrational values of $x$, the expression $x + {\large{\frac{1}{x}}}$ can be made equal to any positive integer $n > 2$, for some some positive irrational number $x$.
- For positive rational values of $x$, the expression $x + {\large{\frac{1}{x}}}$ is an integer if and only if $x=1$.