Let $f(x)=\frac{x}{1-x}$. Determine the largest subset of the set of real numbers where for every positive integer $n$, the composite function

$$
f^{(n)}(x)=\underbrace{f(f(\ldots(f}_{n \text{ times}}(x)) \ldots))
$$

is defined.
Solution. $f(x)$ is undefined when $x=1$. $f^{(2)}(x)=f(f(x))$ is undefined if $f(x)$ is undefined (i.e., $x \neq 1$), or if $f(x)=1$. The solution to $\frac{x}{1-x}=1$ is $x_{1}=\frac{1}{2}$. Similarly, we find that $f^{(3)}(x)$ is undefined if $x=1, x=\frac{1}{2}$, or $f(x)=\frac{1}{2}$. Continuing, we find that for the sequence $x_{k}$,

$$
\ldots \xrightarrow{f} x_{k} \xrightarrow{f} x_{k-1} \xrightarrow{f} \ldots \stackrel{f}{\longrightarrow} x_{2} \xrightarrow{f} x_{1} \xrightarrow{f} x_{0}=1,
$$

i.e., $x_{i}=f\left(x_{i+1}\right)$, $f^{(n)}\left(x_{i}\right)$ is undefined if $n \geq i$. Conversely, if $f^{(n)}(x)$ is undefined, then either $f^{(n-1)}(x)$ is also undefined, or $f^{(n-1)}(x)=1$. Since the function $f$ is bijective, the sequence $x_{k}$ is uniquely determined.

To determine the sequence, consider the inverse of the function $f$: $f^{-1}(x)=\frac{x}{x+1}$. Thus, the above sequence in reverse is:

$$
1=x_{0} \xrightarrow{f^{-1}} x_{1} \xrightarrow{f^{-1}} x_{2} \xrightarrow{f^{-1}} \ldots \xrightarrow{f^{-1}} x_{k} \xrightarrow{f^{-1}} x_{k+1} \xrightarrow{f^{-1}} \ldots,
$$

from which we get the recursion $x_{0}=1, x_{n+1}=\frac{x_{n}}{1+x_{n}}$. The first few terms of the sequence are:

$$
x_{0}=1 ; \quad x_{1}=\frac{1}{2} ; \quad x_{3}=\frac{1}{3} ; \quad \ldots
$$

We prove by induction that $x_{n}=\frac{1}{n}$. For $n=1$, this is true. Let $n \geq 1$ and assume that $x_{n}=\frac{1}{n}$. Then

$$
x_{n+1}=\frac{\frac{1}{n}}{1+\frac{1}{n}}=\frac{1}{n+1}
$$

indeed.

The desired set is therefore $\mathbb{R} \backslash\left\{\frac{1}{n}: n \in \mathbb{N}^{+}\right\}$.

Remarks. 1. If we introduce the substitution $y_{n}=\frac{1}{x_{n}}$ in the obtained recursion, then

$$
y_{0}=1, \quad \frac{1}{y_{n+1}}=\frac{\frac{1}{y_{n}}}{1+\frac{1}{y_{n}}}=\frac{1}{1+y_{n}}, \quad \text { i.e., } \quad y_{n+1}=1+y_{n}
$$

so it is immediately clear that $y_{n}=n$ and thus $x_{n}=\frac{1}{n}$.

2. If, after similar experimentation, we conjecture that $f^{(n)}(x)=\frac{x}{1-n x}$, then this can also be easily proven by induction, and from this the statement of the problem follows immediately.
3. If, for example,

$$
f(x)=\frac{x+3}{2 x-1}
$$

then the sequence $\left(x_{n}\right)$ immediately "gets stuck," as the function $f$ does not take the value $\frac{1}{2}$, which is missing from its domain, and thus the functions $f^{(n)}(x)$ are only undefined at $\frac{1}{2}$. (Now write down the functions $f^{(n)}(x)$.)