# Find all continuous functions $f:\mathbb R\to\mathbb R$ such that $f(x)^2-2\big\lfloor2|f(2x)|\big\rfloor f(x)+\big\lfloor{4f(2x)^2-1}\big\rfloor=0$.

Find all continuous functions $$f:\mathbb{R} \to \mathbb{R}$$ such that $$f(x)^2 - 2\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor f(x) + \Bigl\lfloor{4f(2x)^2-1}\Bigr\rfloor = 0\,\text.$$

Here is my attempt:

$$f(x)^2 - 2\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor f(x) + \Bigl\lfloor{4f(2x)^2-1}\Bigr\rfloor = 0$$

$$\implies \biggl(f(x) - \Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor\biggr)^2 -1 = 0$$

$$\implies f(x) - \Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor = \pm1\,$$.

We have two cases:

1. When: $$f(x) = 1+ \Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor$$ so we can conclude these:
• since $$\ \Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor\geq 0 \ \& \ 1 \geq 1$$ we have $$\ \ \forall x \in \mathbb{R}\ \ :\ f(x) \geq 1\,$$.
• from above note and $$\ \left \lfloor{2f(2x)}\right \rfloor \in \mathbb{N} \ \ \& \ 1 \in \mathbb{N}$$ we have $$\ \ \forall x \in \mathbb{R}\ \ :\ f(x) \in \mathbb{N}\,$$.
2. Similary, When: $$f(x) = -1+ \Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor$$ so we can conclude these:
• since $$\ \Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor\geq 0 \ \& \ -1 \geq -1$$ we have $$\ \ \forall x \in \mathbb{R}\ \ :\ f(x) \geq -1\,$$.
• from above note and $$\ \left \lfloor{2f(2x)}\right \rfloor \in \mathbb{Z} \ \ \& \ 1 \in \mathbb{Z}$$ we have $$\ \ \forall x \in \mathbb{R}\ \ :\ f(x) \in \mathbb{Z}\,$$.

Now if $$f\$$ is continuous on $$\ \mathbb{R}\$$ and $$\left \lfloor{f(x)}\right \rfloor$$ is continuous on $$(k, k+1)$$ then $$\left \lfloor{2f(x)}\right \rfloor$$ is continuous on $$\left (\frac{k}{2}, \frac{k+1}{2} \right )$$.

After that I don't know what to do. I hope I am on the right path.

What follows is not a complete answer, but hopefully it will help to solve the problem.

Let $y=2\,\bigl|f(2x)\bigr|$ and $n=\lfloor y\rfloor$. Then $n\geq0$, and the functional equation can be rewritten as

$$f(x)^2-2nf(x)+\lfloor y^2\rfloor-1=0\,,$$

hence the corresponding discriminant must be nonnegative, that is $4n^2-4\bigl(\lfloor y^2\rfloor-1\bigr)\geq0$, and so $\lfloor y^2\rfloor\leq n^2+1$. If $y=n+a$ then $\lfloor y^2\rfloor=n^2+\lfloor2na+a^2\rfloor$, so the previous inequality becomes $\lfloor2na+a^2\rfloor\leq1$, which is equivalent to $2na+a^2<2$. Since $2na+a^2$ is strictly increasing as a function of $a\geq0$, it follows that $\lfloor2na+a^2\rfloor\leq1$ iff $a<a_n$, where $a_n\geq0$ satisfies $2na_n+a_n^2=2$, that is $a_n=\sqrt{n^2+2}-n$.

Note that $a_n\geq1$ when $n=0$ and $a_n<1$ otherwise. We have shown then that the image of the function $2\bigl|f(2x)\bigr|$ must be contained in the union

$$[0,1)\cup\bigcup_{n\geq1}[n,n+a_n)=[0,\sqrt3\,)\cup\bigcup_{n\geq2}\bigl[n,\sqrt{n^2+2}\,\bigr)\,,$$

the latter being a union of intervals with pairwise disjoint closures. Since this function is continuous, its image is an interval, so by connectedness it must be contained in exactly one of the intervals above. In other words, we have exactly one of the following possibilities:

• $0\leq2\bigl|f(2x)\bigr|<\sqrt3$ for all $x$;
• There is exactly one number $m\in\mathbb N$ with $m\geq2$, such that $m\leq2\bigl|f(2x)\bigr|<\sqrt{m^2+2}$ for all $x\,.$

The second case is slightly better, because in that case $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor$ is constant equal to $m$, so the functional equation simplifies a bit (the nasty term accompanying $f(x)$ now is constant). This does not happen in the first case because $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor$ can be $0$ or $1$, but perhaps the method of solution for the case $m\geq2$ applies in this case as well in some way.

UPDATE

The set $A=\{\alpha\in\mathbb R\setminus\mathbb Q: \alpha^2\in\mathbb Q\ \text{or}\ -\alpha^2\in\mathbb Q\}$ of non-rational square roots of rational numbers is dense in $\mathbb R$ (Proof: If $0<c<d$ and $p$ is a prime large enough then for some natural number $k$ we have $(cp)^2-\frac1p<k<(dp)^2-\frac1p$, so $c<\alpha<d$, where $\alpha=\sqrt{\frac{kp+1}{p^3}\,}\notin\mathbb Q$ but $\alpha^2\in\mathbb Q$).

If $f(x)\in A$ then $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor$ must be $0$: in fact, we have

$$-2\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor f(x)=-f(x)^2-\Bigl\lfloor{4f(2x)^2-1}\Bigr\rfloor\in\mathbb Q\ \ \text{if}\ \ f(x)^2\in\mathbb Q\,,$$

so if $f(x)\notin\mathbb Q$ then necessarily $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor=0$ (this remark was pointed out in a previous answer by someone else; the answer was deleted). If $f$ were not constant then the image of $f$ would contain some open interval, so $f(x)\in A$ for some $x$, which prevents the second possibility mentioned before, because under such condition we have $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor=m$ for all $x$, with $m\geq2$ fixed. Therefore we have $0\leq2\bigl|f(2x)\bigr|<\sqrt3$ for all $x$ if $f$ is not constant, which implies that $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor=0$ or $1$.

If $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor=0$ for some $x$ then $0\leq2\bigl|f(2x)\bigr|<1$, so $-1\leq4f(2x)^2-1<0$, which shows that $\bigl\lfloor4f(2x)^2-1\bigr\rfloor=-1$. The functional equation becomes $f(x)^2-1=0$, and so $\bigl|f(x)\bigr|=1$, which is impossible because $\bigl|f(2z)\bigr|<\sqrt3/2<1$ for all $z$. Consequently we have $\Bigl\lfloor\,2\,\bigl|f(2x)\bigr|\,\Bigr\rfloor=1$ for all $x$, and so $0\leq4f(2x)^2-1<2$, which implies that $\bigl\lfloor4f(2x)^2-1\bigr\rfloor=0$ or $1$. The functional equation becomes $f(x)^2-2f(x)+\beta=0$, with $\beta=0$ or $1$. If $\beta=1$ then we have $\bigl(f(x)-1\bigr)^2=0$, which is impossible because $\bigl|f(x)\bigr|<1$, so necessarily $\beta=0$. Thus we have $f(x)^2-2f(x)=f(x)\bigl(f(x)-2\bigr)=0$ for all $x$, and since $f(x)\ne2$ for all $x$, it follows that $f$ is constant and equal to $0$, which contradicts our initial hypothesis (not to mention that $f=0$ does not satisfy the functional equation).

Therefore our function $f$ must be constant. Later I will try to deal with this easier remaining situation.

LAST UPDATE (WITH COMPLETE SOLUTION)

The previous argument can be simplified a lot. Let $y=2\,\bigl|f(2x)\bigr|$ and $n=\lfloor y\rfloor$. Then $n\geq0$, and the functional equation can be rewritten as $f(x)^2-2nf(x)+\lfloor y^2\rfloor-1=0\,,$ hence the corresponding discriminant must be nonnegative, that is $4n^2-4\bigl(\lfloor y^2\rfloor-1\bigr)\geq0$, and so $\lfloor y^2\rfloor\leq n^2+1$. On the other hand, $0\leq n\leq y$ implies $n^2\leq y^2$, and so $n^2\leq\lfloor y^2\rfloor$. Consequently we have $\lfloor y^2\rfloor=n^2+b$, where $b$ is $0$ or $1$.

Replacing into the original equation we obtain $f(x)^2-2nf(x)+n^2+b-1=0$, that is $\bigl(f(x)-n\bigr)^2=1-b\in\{0,1\}$, and so the only possibilities for $f(x)$ are $n,n+1$ or $n-1$. Thus, $f$ is integer-valued, and since $f$ is continuous, it follows that $f$ must be constant, say $f(x)=c$; moreover $c$ satisfies $c\in\{n,n+1,n-1\}$, being $n=\lfloor y\rfloor=\bigl\lfloor2|c|\bigr\rfloor=2|c|$. In other words, $c$ is an integer satisfying $c\in\bigl\{2|c|,2|c|+1,2|c|-1\bigr\}$. Since $f(x)=0$ is not a solution of the functional equation then $c\ne0$, so $c=2|c|$ is impossible. If $c=2|c|+1$ then $c\geq0$, so $|c|=c$, and we obtain the equality $c=2c+1$, which is impossible as well. Finally if $c=2|c|-1$ then $c\ne-1$ and $c+1=2|c|\geq0$, so $c\geq0$, and the equality becomes $c=2c-1$, which implies that $c=1$. It is easily checked that $f(x)=1$ satisfies your functional equation, so it is the only continuous solution.