Consider the following problem:
Is it true, that any odd continuous function satisfying $f(2x) = 2f(x)$ is linear?
Does the following function (which I found here) can serve as a counterexample?
$$ f(x) = \begin{cases} x\cos(2\pi \log_2(x)), & \mbox{if } x>0 \\ 0, & \mbox{if } x=0 \\ x\cos(2\pi \log_2(-x)) & \mbox{if } x<0 \end{cases} $$
If it can, are there any "simpler" ones? I mean, that task was given on exam, and it would be rather difficult to come up with such a function on your own. By what strategy can one construct a similar counterexample from scratch? It feels like some piecewise linear function could do the trick, but I can't figure out, how to build it.
$f$ DOES NOT have to be linear!
Let $g:[1,2]\to\mathbb R$ continuous and arbitrary, so that $g(1)=g(2)$, and extend $g$ to $(0,\infty)$, so that $g|_{[2^{k},2^{k+1}]}$ is defined as $$ g(x)=g(2^{-k}x),\quad x\in [2^{k},2^{k+1}]. $$ Then $$ f(x)=xg(x), \quad (0,\infty), $$ satisfies $f(2x)=2f(x)$, it is continuous, extends continuously to $x=0$, with $f(0)=0$, and extends, as an odd function continuously in $\mathbb R$, as $f(-x)=f(x)$, for $x<0$.