# How to find all possible continuous functions given what the function does to each value.

Question: Find all possible continuous functions $f:[0,1]\to \mathbb{R}$ such that $\forall x \in [0,1]$ we have $(f(x))^2=1$

My Work: I truly am not sure how to go about this. I don't quite understand what they mean by find all continuous functions. Any help on explaining what this question is asking would be great. Thanks

-
If $(f(x))^2=1$, then $f(x)$ has to be $\pm 1$ right? Then, ask yourself if it can be $1$ for some $x$'s and $-1$ for others while also being continuous. This should lead you to the answer. –  icurays1 Nov 12 '12 at 19:19
Since $[0,1]$ is connected, if $f$ is continuous, then $f[0,1]$ must be connected too. The constraint implies $f(x) = \pm 1$ for all $x$, hence it must take exactly one of these values (otherwise the range in not connected). –  copper.hat Nov 12 '12 at 19:20

There are only two of them, the constant functions $1$ and $-1$.

Clearly $f(x)=\pm 1$ for all $x$. If there are places $a$ and $b$ such that $f(a)=-1$ and $f(b)=1$, then by the Intermediate Value Theorem there is a $c$ between $a$ and $b$ such that $f(c)=0$. This is impossible.

-

Let $f$ be one such function.

Take a specific $x_1$ (say, $x_1=0.22$).

What could $f(x_1)$ be? (hint: only two values are possible).

Now, take some other $x_2$ (say, $x_2=0.37$).

What could $f(x_2)$ be?

Suppose it is different from $f(x_1)$. What does the intermediate value theorem tell you?

-

What does $(f(x))^2=1$ say about $f(x)$? Then what does the continuity imply?

-

Depending on your definition of the real numbers - and if you haven't studied connectedness yet, you might want to identify the value of $f(0)$ and look at $X= \sup x:f(x)=f(0)$ and apply continuity at $X$.

-
There is a trick you can use, which is to extend the condition so that $f(x)=f(0)$ and there is no $y<x : f(y) \neq f(x)$ - which mirrors some proofs of the intermediate value theorem (see André Nicholas' answer). –  Mark Bennet Nov 13 '12 at 2:57