<s>[INST] Function $f$ such that $f(x+a) = \frac12 + \sqrt {f(x)-(f(x))^2}$ is periodic. 
Let $f$ be a real valued function defined for all real numbers $x$ such that for some positive constant $a$ the equation $f(x+a) = \frac12 + \sqrt {f(x)-(f(x))^2}$ holds for all $x$. Prove the function $f$ is periodic. 

I have tried by replacing $x$ several times but couldn't find the period.
 [/INST] Note that $f(x)-f^2(x)\ge 0$ and thus $0\leq f(x)\leq 1$. Also $f(x)-\frac{1}{2}\ \ge 0$ which imply $\frac{1}{2}\le f(x)\le 1 $.
Now we compute $f(x+2a).$
$$f(x+2a)=\frac{1}{2}+\sqrt{f(x+a)-f^2(x+a)}\,.$$
$$f(x+a)-f^2(x+a)=f(x+a)-\frac{1}{4}-\sqrt{f(x)-f^2(x)}- f(x)+f^2(x)=$$
$$=f^2(x)-f(x)+\frac{1}{4}.$$
$$f(x+a)-f^2(x+a) =\left(\frac{1}{2}-f(x)\right)^2.$$ and then:
$$f(x+2a)=\frac{1}{2}+|\frac{1}{2}-f(x)|=$$
$$=\frac{1}{2}-\frac{1}{2}+f(x)$$ since $f(x)-\frac{1}{2}\ge 0.$
$$\text {Therefore }\;f(x+2a)=f(x).$$
</s>