The question is,
Find function $f(x)$, if $f(x+ \frac{1}{x}) = x^2 + \frac{1}{x^2}$.
What does this mean?
Do I have to find $x$ in $x+ \frac{1}{x} = x^2 + \frac{1}{x^2}$? In this case (not counting solutions in the complex plane), $x = 1; f(x) = 2$.
Or replace all $x$'s in $x+ \frac{1}{x}$, so that it would equal $x^2 + \frac{1}{x^2}$? In that case, $f(x) = x^2$
Or some other option?
Observe that
$$\left(x+\frac1x\right)^2=x^2+\frac1{x^2}+2$$
so in fact
$$f(x):=x^2-2\;\;\;\text{gives}\;\;\;f\left(x+\frac1x\right)=\left(x+\frac1x\right)^2-2=x^2+\frac1{x^2}$$