Let $a \in \mathbb{R}$. Consider the following functional equation:

$$
f(0)=0, f(1)=1, \text{ if } x \leq y, f\left(\frac{x+y}{2}\right)=(1-a) f(x)+a f(y)
$$

Find the $a$ for which the equation admits at least one solution $\mathbb{R} \rightarrow \mathbb{R}$. The same question when we want a continuous solution.
Let's start by calculating $f$ for a few values: $f(1 / 2) = a$, $f(1 / 4) = a^{2}$, $f(3 / 4) = 2a - a^{2}$. Now, taking $x = 1 / 4$ and $y = 3 / 4$:

$$
a = (1 - a) a^{2} + a(2a - a^{2})
$$

By moving all terms to one side, we get $a(3a - 2a^{2} + 1) = 0$. This equation has three solutions: $a = 0$, $\frac{1}{2}$, and 1.

For $a = 0$, we find the solution $f(x) = 0$ except at $x = 1$, where $f(1) = 1$. For $a = 1$, we find $f(x) = 1$ on $]0, 1]$ and $f(0) = 0$. For $a = \frac{1}{2}$, we find $f(x) = x$. We verify that these functions satisfy the functional equation.

Now, if we look for continuous solutions, the functions found for $a = 0$ and 1 no longer work. Let's show that we cannot find continuous solutions. Consider the case $a = 1$. A small induction shows that $f\left(\frac{1}{2^{n}}\right) = 1$ for all $n$, but $\frac{1}{2^{n}}$ tends to 0, and if the function were continuous, their images should tend to $f(0) = 0$. This is not the case, so any solution to the functional equation is discontinuous. The case $a = 0$ is similar.