Consider this functional equation: $$f(x+\frac{1}{x})=x, x\ne0$$ We can solve it easily by setting $y = x+\frac{1}{x}$ and solving for $x$. It's just a quadratic equation in $x$: $x=\frac{y\pm\sqrt{y^2-4}}{2}$ so finally we have $f(y)=\frac{y\pm\sqrt{y^2-4}}{2}$ - or if we want to, we can change $y$ back to $x$: $$f(x)=\frac{x\pm\sqrt{x^2-4}}{2}$$ It can be easily checked that this solution satisfies the original equation.
However the problem is that $x+\frac{1}{x}$ is symmetric about the multiplicative inverse for $x$. That is, if we replace $x$ with $\frac{1}{x}$ it doesn't change. Thus we can do it with the argument on the left hand side of the equation - but the right hand side will then change to $\frac{1}{x}$ and our solution will no longer work.
Furthermore, if we do the change, we will get that $$\forall x\ne0, \frac{1}{x} = f(x+\frac{1}{x})=x$$ thus $\forall x\ne0,x = \frac{1}{x}$ which means we have a contradiction and thus no such function $f(x)$ exist.
Which solution method is correct? Am I missing something here?
How do you want to interpret the $\pm$ in the first attempt? $f$ is a function, so it cannot have more than one output for any given input. As it stands, you have two outputs for any given $|x| \geq 2$.
This agrees with the second method, which ultimately says your $f$ has two outputs $x, 1/x$ for any given $x+\frac1x$. It also implies that no matter which choice of $+$ or $-$ you make in your first attempt, your result will fail to satisfy the functional equation for some [infinitely many] $x$.