I'm trying to solve it by any way that I know or solving these kind of problems, but apparently such an equation has a specific way of solving. What's the point?
If $f(x) + x f(-x) = x^2$ + 1, find what is $f(x)$ ?
or this one:
If $f(1/x)- 2f(x) = x^2 + 1/x$, find what is $f(x)$?
Since the identity holds for every $x$, you can also use $-x$ to get $$ f(-x)-xf(x)=(-x)^2+1 $$ and therefore $f(-x)=x^2+1+xf(x)$, leading to $$ f(x)+x(x^2+1)+x^2f(x)=x^2+1 $$ and you should be able to finish.
The second one is similar: with $1/x$ instead of $x$ you get $$ f(x)-2f(1/x)=(1/x)^2+x $$ and now it's easy to eliminate $f(1/x)$. There is no “general method”, though.