## Task B-4.3.

Determine $f^{2018}(2018)$ if for the function $f: \mathbb{R} \rightarrow \mathbb{R}$ it holds that

$$
(x-1) f(x)+f\left(\frac{1}{x}\right)=\frac{1}{x-1}
$$

Note: $f^{2018}(x)=(\underbrace{f \circ f \circ \ldots \circ f}_{2018})(x)$.
## Solution.

By substituting $x=t$ and $x=\frac{1}{t}$ into the given functional equation, we obtain the system:

$$
\begin{aligned}
(t-1) f(t)+f\left(\frac{1}{t}\right) & =\frac{1}{t-1} \\
f(t)+\left(\frac{1}{t}-1\right) f\left(\frac{1}{t}\right) & =\frac{1}{\frac{1}{t}-1}=\frac{t}{1-t}
\end{aligned}
$$

Multiplying the first equation by $1-\frac{1}{t}$ and adding it to the second, we get:

$$
\begin{aligned}
{\left[(t-1)\left(1-\frac{1}{t}\right)+1\right] f(t) } & =\frac{1}{t-1} \cdot\left(1-\frac{1}{t}\right)+\frac{t}{1-t} \\
\left(t-1-1+\frac{1}{t}+1\right) f(t) & =\frac{1}{t-1} \cdot \frac{t-1}{t}+\frac{t}{1-t} \\
\frac{t^{2}-t+1}{t} \cdot f(t) & =\frac{1}{t}+\frac{t}{1-t} \\
\frac{t^{2}-t+1}{t} \cdot f(t) & =\frac{1-t+t^{2}}{t(1-t)} \\
f(t) & =\frac{1}{1-t}
\end{aligned}
$$

Now we compute the compositions in sequence:

$$
\begin{aligned}
f^{2}(x) & =(f \circ f)(x)=\frac{1}{1-\frac{1}{1-x}}=\frac{x-1}{x}=1-\frac{1}{x} \\
f^{3}(x) & =\frac{1}{1-1+\frac{1}{x}}=x \\
f^{4}(x) & =\frac{1}{1-x}=f(x)
\end{aligned}
$$

Clearly, these three functions will repeat when computing the composition $f^{n}(x)$ depending on the remainder when $n$ is divided by 3. For $n=2018$, the remainder is 2, so

$$
f^{2018}(2018)=f^{2}(2018)=\frac{2018-1}{2018}=\frac{2017}{2018}
$$