When I tried solve it I had found just answer "No". I spoke with some people but I cannot understand why the answer is exactly it...


Frankly speaking, this function haunts me:


$f(x) = abs((abs(x) - floor\_2(abs(x))) / floor\_2(abs(x)) - 0.5)$


abs - absolute value of a number


or the same: $$f(x) = |\frac{|x| - floor\_2(|x|)}{floor\_2(|x|)} - \frac{1}{2}|$$


$floor\_2$ - function which returns maximize number which equals power of two (2^), and which less parameter number. Sorry, I can't come up simpler. I hope with examples will be simpler:


$floor\_2(4)=4=2^2; floor\_2(5)=4=2^2; floor\_2(7)=4=2^2; floor\_2(9)=8=2^3; floor\_2(157)=128=2^7; floor\_2(1234)=1024=2^{10}; floor\_2(0.6)=0.5=2^{-1}; floor\_2(0.123)=0.0625=2^{-4}; floor\_2(1/3)=0.25=2^{-2}$


Also for the best understanding I specify results of function $f(x)$:
(for the best understanding I executed nested "abs")


$$f(6)=|\frac{6-4}{4}-\frac{1}{2}|=0\\
f(12)=|\frac{12-8}{8}-\frac{1}{2}|=0\\
f(-12)=|\frac{12-8}{8}-\frac{1}{2}|=0$$


$$f(7)=|\frac{7-4}{4}-\frac{1}{2}|=\frac{1}{4}\\
f(14)=|\frac{14-8}{8}-\frac{1}{2}|=\frac{1}{4}\\
f(5)=|\frac{5-4}{4}-\frac{1}{2}|=\frac{1}{4}\\
f(10)=|\frac{10-8}{8}-\frac{1}{2}|=\frac{1}{4}$$


$$f(\frac{1}{3})=|\frac{1/3-1/4}{1/4}-\frac{1}{2}|=\frac{1}{6}\\
f(\frac{2}{3})=|\frac{2/3-1/2}{1/2}-\frac{1}{2})=\frac{1}{6}$$


Could you help me to understand why this function cannot be answer? Or maybe function exists...



Does function $f(x)=f(2x)$, $f(x)$ - non const, exist? ($f(x)$ - continuous function on real numbers)
Note that $floor\_2(x)=2^{\lfloor{\log\_2x}\rfloor}$.


Your function does satisfy $f(x)=f(2x)$, but it is not continuous at $x=0$ ([graph](https://www.desmos.com/calculator/ohjsn7r8oe)).
For a proof that your function is not continuous at $x=0$, note that
$$f(2^{-n})=\left\lvert\frac{2^{-n}-floor\_2(2^{-n})}{floor\_2(2^{-n})}-\frac{1}{2}\right\rvert=\left\lvert\frac{2^{-n}-2^{-n}}{2^{-n}}-\frac{1}{2}\right\rvert=\left\lvert0-\frac{1}{2}\right\rvert=\frac{1}{2}$$
and
$$f(3\cdot2^{-n})=\left\lvert\frac{3\cdot2^{-n}-floor\_2(3\cdot2^{-n})}{floor\_2(3\cdot2^{-n})}-\frac{1}{2}\right\rvert=\left\lvert\frac{3\cdot2^{-n}-2\cdot2^{-n}}{2\cdot2^{-n}}-\frac{1}{2}\right\rvert=\left\lvert\frac{1}{2}-\frac{1}{2}\right\rvert=0$$
so there is no choice of $f(0)$ that makes your function continuous.


Indeed, there is no such function (as I prove in my comment on the question).


