TITLE: Find $f(x)$ given that $xf(x)+f(-x)=x$
QUESTION [5 upvotes]: $$xf(x)+f(-x)=x$$
$$f(x)= ?$$
I saw this question in a group and couldn't find a way out of it. I've tried various things one of which is down below but these don't seem to work out.
$$xf(x) + f(-x) = x$$
$$xf(-x)-f(x) = x$$
$$xf(x)+f(-x) = xf(-x) -f(x)$$
$$f(x)+f(-x)=x\left(f(-x)-f(x)\right)$$
I actually did proceed from here but it really was not useful at all. I even tried taking derivatives etc. but none of them worked.
I searched this functional equation question on Web but didn't find anything related to this. Any help would be greatly appreciated.

REPLY [4 votes]: $$ xf(x)+f(-x)=x~~~~(1)$$
Change $x\to -x$ to get
$$-xf(-x)+f(x)=-x~~~~(2)$$
Let $f(x)=A, f(-x)=B$,
then (1) and (2) become
$$xA+B=x ~ \& ~-xB+A=-x$$
Solve these two as linear simultaneous equations in $A$ and $B$, to get
$$B=\frac{x^2+x}{1+x^2}=f(-x)$$
and
$$A=\frac{x^2-x}{1+x^2}=f(x)$$