Solution (source code)

= Solution

Replace $x$ by $1/x$, which stays in the domain of the <functional equation>. Writing $u=f(x)$ and $v=f(1/x)$ gives the <linear system>
$$
u+2v=x,\qquad 2u+v=\frac1x.
$$
Twice the second equation minus the first gives $3u=2/x-x$, so the only possible <function> is
$$
\boxed{f(x)=\frac{2/x-x}{3}\quad(x>0)}.
$$
To check existence as well as uniqueness, substitute this expression: $f(x)+2f(1/x)=(2/x-x+4x-2/x)/3=x$.