Nowhere continuous functions $f: \mathbb{R} \to \mathbb{R}$ such that $f\bigl(f(x)\bigr) = \frac{f(2x)}{2}$ I'm looking for a function $f: \mathbb{R} \to \mathbb{R}$ that is continuous at no point and satisfies the identity
$$f\bigl(f(x)\bigr) = \frac{f(2x)}{2}$$
for all $x \in \mathbb{R}$.
This is not a homework question, but rather a curiosity of mine. There is absolutely no context, I just thought of it.
$f(x)=x$ is the example that made me think of this problem, but there are other solutions of the functional equation obviously, for example $f(x)=0$ for all $x$.
I was only able to notice that if $f$ is not identically $0$ then $f(\mathbb{R})$ is an infinite set.

Pick a basis $a_r$ of $\mathbb R$ over $\mathbb Q$ that contains $1$ (this of course assumes the Axiom of Choice at least in some weaker forms but is standard in usual math).
Let $f: \mathbb R \to \mathbb Q$ the additive function defined in the usual way by the basis so if $x=\sum q_ra_r, q_r \in \mathbb Q, q_r=0$ for all but finitely many $r$ (and of course $q_r$ unique) , then $f(x)=\sum q_r$, hence $f(x+y)=f(x)+f(y)$ and in particular $f(2x)/2=f(x)$ for all $x \in \mathbb R$
Then $f(q)=q$ for $q \in \mathbb Q$ since $1$ is in the basis and since for any $x \in \mathbb R$ we have $f(x) \in \mathbb Q$, we get $f(f(x))=f(x)=f(2x)/2$ and of course $f$ is highly discontinuous and there are lots of such.
