Suppose, (towards a contradiction) that $f$ is not constant. Then for at least one $b \in \mathbb{R}$, $f(1) \neq f(b)$. First, consider the case where $b \neq 0$. WLOG $b \in \mathbb{R}^+$ [if not, then consider $b^2 \in \mathbb{R}^+$, the rest of the procedure will remain the same since $f(b^2)=f(b)\neq f(1)$]
By the hypothesis, $f(b^{1/2}) =f (b) \neq f(1)$. Iterating the process, $f( b^{ \frac{1}{2^n}})\neq f(1)$. Letting $n \to \infty $, we get either $\lim_{x\to 1^-}f(x)$ or $\lim_{x \to 1^+}f(x) \neq f(1)$ [depending on whether $b<1$ or $b>1$ respectively]. But, by sequential crite…