4.1. The function $f$ satisfies the equation $(x-1) f(x)+f\left(\frac{1}{x}\right)=\frac{1}{x-1}$ for each value of $x$, not equal to 0 and 1. Find $f\left(\frac{2016}{2017}\right)$.
Answer: 2017.

Solution. Substitute $\frac{1}{x}$ for $x$ in the equation. Together with the original equation, we get a system of two linear equations in terms of $f(x)$ and $f\left(\frac{1}{x}\right)$:

$$
\left\{\begin{array}{l}
(x-1) f(x)+f\left(\frac{1}{x}\right)=\frac{1}{x-1} \\
\left(\frac{1}{x}-1\right) f\left(\frac{1}{x}\right)+f(x)=\frac{x}{1-x}
\end{array}\right.
$$

Subtracting the first equation, multiplied by $\frac{1-x}{x}$, from the second equation, we get $\left(1+\frac{(1-x)^{2}}{x}\right) f(x)=\frac{x}{1-x}+\frac{1}{x}$, which simplifies to $\frac{x^{2}-x+1}{x} f(x)=\frac{x^{2}-x+1}{x(1-x)}$, or $f(x)=\frac{1}{1-x}$. Therefore, $f\left(\frac{2016}{2017}\right)=2017$.