Problem 12.3. Let $\mathbb{R}$ be the set of real numbers. Find all $a>0$ such that there exists a function $f: \mathbb{R} \rightarrow \mathbb{R}$ with the following two properties:
a) $f(x)=a x+1-a$ for any $x \in[2,3)$;
b) $f(f(x))=3-2 x$ for any $x \in \mathbb{R}$.

Oleg Mushkarov, Nikolai Nikolov
12.3. Setting $h(x)=f(x+1)-1$, it is easy to see that the conditions for $f(x)$ are equivalent to $h(x)=a x$ for any $x \in[1,2)$ and $h(h(x))=-2 x$ for any $x \in \mathbb{R}$. Then $h(-2 x)=h(h(h(x)))=-2 h(x)$; in particular, $h(0)=0$.

It follows by induction that $h\left(4^{n} x\right)=4^{n} h(x)$ and hence $h(x)>0$ for $x \in$ $\left[4^{n}, 2.4^{n}\right)$, where $n$ is an arbitrary integer. Since $0>-2 x=h(h(x))=h(a x)$ for $x \in[1,2)$, then $[a, 2 a) \subset\left[2.4^{k}, 4^{k+1}\right.$ ) for some integer $k$. Therefore $a=2.4^{k}$.

Conversely, if $a$ has this form, then it is easy to check that the function

$$
h(x)=\left\{\begin{aligned}
a x, & x \in\left[4^{n}, 2.4^{n}\right) \\
-\frac{2 x}{a}, & x \in\left[2.4^{n}, 4^{n+1}\right) \\
0, & x=0 \\
a x, & x \in\left(-4^{n+1},-2.4^{n}\right] \\
-\frac{2 x}{a}, & x \in\left(-2.4^{n},-4^{n}\right]
\end{aligned}\right.
$$

where $n$ runs over all integers, has the desired properties. One can easily show that this is the only function with the above properties.