# How many continuous functions $f$ are there which satisfy $(f(x))^{2} = x^{2}$ - How to approach?

My question though revolves around how to approach the question in a "thinking" way. So mechanically looking at the expression one would take the square root of both sides and end up with:

$$f(x) = \pm x$$

But this doesn't really say anything about how to interpret the result. So in the other post the solutions revolved around looking at the behaviour of $$x$$ between $$(-\infty,0)$$ and $$(0,\infty)$$ and applying the intermediate value theorem. But what is accomplished by showing that $$f(x)$$ does not change sign? and also how do you arrive at the second set of solutions? Specifically I'm aware of the relationship $$\sqrt{x^{2}} = |x|$$, but knowing the relationship doesn't mean I know how to apply it correctly.

• We know, for instance, that $f(1)=\pm1$. Say it is $+1$. Then we know that $f(x)=x$ for all $x≥0$ because the function can not change sign in that region. Similarly, if $f(1)=-1$ we know that $f(x)=-x$ for all $x≥0$. – lulu Jun 23 '20 at 18:04

There are $$4$$ such functions. Namely $$x\mapsto\pm x$$ and $$x\mapsto\pm|x|$$. This follows from the method suggested by @lulu in the comments. We know that $$f(0)=0$$ from the defining equation. Then consider some $$\epsilon\gt0$$. We know that $$(f(\epsilon))^2=\epsilon^2$$ and hence either $$f(\epsilon)=\epsilon$$ or $$f(\epsilon)=-\epsilon$$. Using the continuity of $$f$$ and applying the same reasoning for any other $$x\gt0$$ gives $$f(x)=x$$ or $$f(x)=-x$$ for all $$x\gt0$$ in each case respectively. Similarly we have either $$f(x)=x$$ or $$f(x)=-x$$ for all $$x\lt0$$. Combining these $$4$$ cases gives the $$4$$ functions originally stated.

• From how you explained it I gather the first ting you asked yourself is "where could the function change sign?", from there you reasoned the rest out. I could see how $\pm |x|$ would come about, but why would $\pm x$ be separate cases? Aren't they contained within the $|x|$ cases? – dc3rd Jun 23 '20 at 18:22
• Ok I think I figured it out. I realized I put up an artificial restriction which really was holding me back. For some reason I didn't want to accept (or realize) that I can define functions piece wise.....that made it more difficult for me to reconcile everything. – dc3rd Jun 23 '20 at 18:47

This answer might be a bit pedantic and not in the spirit of the question:

It depends on the domain of the function $$f$$. Let us say that the domain of $$f$$ is a subset of $$\mathbb{C}$$ called $$D$$, i.e., $$f$$ is a continuous function $$D \to \mathbb{C}$$ with the property that $$f(x) \in \{x, -x\}$$ for all $$x$$. We can now define the function $$g$$ on $$D \setminus \{0\}$$ by setting $$g(x) = f(x)/x$$. Note that $$g$$ is continuous and $$g(x) \in \{1,-1\}$$ for all $$x \in D \setminus \{0\}$$. Because $$g$$ is continuous and $$\{1,-1\}$$ is discrete, $$g$$ must be constant on every connected component of $$D \setminus \{0\}$$. This gives two possibilities per connected component of $$D \setminus \{0\}$$ (check that any combination yields a valid and distinct function $$f$$).

Examples:

• If $$D = \mathbb{R}$$, then $$D \setminus \{0\} = (-\infty,0) \cup (0,\infty)$$ and you indeed get $$2 \cdot 2 = 4$$ possibilities.
• If $$D = \mathbb{C}$$, then $$D \setminus \{0\} = \mathbb{C} \setminus \{0\}$$, which is connected, so in that case there are only $$2$$ possibilities.
• If $$D = (-1,1) \cup (3,5) \cup (7,10) \cup (12,100)$$, you can check that you get $$32$$ possible functions $$f$$.

The difference between $$x$$ and $$-x$$ is $$2x$$. For any nonzero $$x$$, this is nonzero. Hence a change of sign is not possible, except at the origin.

There are four possible combinations $$(\pm\to\pm$$).