Find $f$ if $f(f(x))=\sqrt{1-x^2}$ Find $f$ if $f(f(x))=\sqrt{1-x^2} \land [-1; 1] \subseteq Dom(f)$
$$$$Please give both real and complex functions. Can it be continuous or not (if f is real)
 A: I guessed that $f$ is of the form $\sqrt{ax^2+b}$. Then, $f^2$ is $\sqrt{a^2x^2 + \frac{a^2-1}{a-1}b}$. From here on in, it is algebra:
$$
a^2 =-1 \implies a = i ~~~~\text{and}~~~~\frac{a^2-1}{a-1}b = 1 \implies b = \frac{1-i}{2}
$$
So we get $f(x) = \sqrt{ix^2 + \frac{1-i}{2}}$. I checked using Wolfram, and $f^2$ appears to be what we want. 
DISCLAIMER: This is not the only solution.
A: Consider real functions on $[0, 1].$ Notice that $\sqrt{1-x^2}$ is an involution, so think of it as a permutation of of the (infinite) set $[0, 1]$ Its cycle type is a product of disjoint transpositions. Now this permutation is supposed to be a square of some other permutation, and while a transposition is not a square of a (finitely supported) permutation, for sign reasons, a product of two disjoint transpositions is (it's a square of a four-cycle). So, break your transpositions into pairs in your favorite way, and there is your function (which is not very continuous, in general). This argument would seem to indicate that you cannot extend such a function to $[-1, 1],$ though I could be wrong.
EDIT The above, can, in fact, be completed to a function defined on $[-1, 1].$ 
Take $x<0.$ if $-x$ fits into a four-cycle $(-x, a, \sqrt{1-x^2}, b)$ map $x$ to $a.$
ANOTHER EDIT of course, this also answers the question of uniqueness: there are uncountably many such functions.
A: I don't know how to approach the real case, but here's a way to solve it if you allow $f$ to be complex.
Start from the guess
$f(x) = \sqrt{1-x^2}$. It almost works, and suggests trying the larger family
$$f(x) = \sqrt{a-bx^2}.$$
For what values of $a,b$ does $f(f(x)) = \sqrt{1-x^2}$?
