10
$\begingroup$

How many functions $f$ are there that satisfy $f(x)^{2}=x^{2}$ for all $x$?

My text (Spivak's Calculus; chapter 7 problem 7) asks this question for continuous $f$, for which the answer is, of course 4:$$f(x)=x$$ $$f(x)=-x$$ $$f(x)=\lvert x \rvert$$ $$f(x)=-\lvert x \rvert,$$ and I want to make sure I'm correct that if $f$ does not have to be continuous, there are infinitely many: any piecwise combination of them (infinitely many of which are one of the above, and infinitely many of which are not).

3 Answers 3

12

You are correct. In fact there are $2^{2^\omega}=2^\mathfrak{c}$ such functions if they need not be continuous. For each $A\subseteq \mathbb{R}$ define $f_A$ as follows: $$f_A(x)=\begin{cases}x,&x\in A\\-x,&x\notin A\end{cases}$$ Then $f_A(x)^2=x^2$ for all $x\in\mathbb{R}$. It’s easy to see that if $A\setminus\{0\}\ne B\setminus\{0\}$, then $f_A\ne f_B$, so we have one such function for every subset of $\mathbb{R}\setminus\{0\}$. Finally, every function with the desired property is such a function: if $f(x)^2=x^2$ for all $x\in \mathbb{R}$, then $f=f_A$, where $A =$ $\{x\in\mathbb{R}:f(x)=x\}$.

If you limit yourself to piecewise continuous functions, there are only $2^\omega=\mathfrak{c}$ of them: there are $(2^\omega)^\omega=2^\omega$ ways to choose the partition points between the pieces, $2^\omega$ ways to choose $x$ or $-x$ on each interval, and $2^\omega$ ways to choose the values at the endpoints, for a total of $(2^\omega)^3=2^\omega$ functions.

  • 0
    @Jonas: Yep, that was sloppy of me; fixed. Thanks.2011-09-15
  • 0
    @Brian: Excellent, thanks! There is some notation I'm not familiar with ($\omega$?) and other's I'm guessing at ($\setminus$) but I get the gist and this fully answers my question.2011-09-15
  • 1
    @raxacoricofallapatorius: $\omega$ is the smallest infinite cardinal number; you may know it under the alias $\aleph_0$. $A\setminus B$ is the set of things that are in $A$ but not $B$; in older and elementary texts it’s often written $A-B$. $\mathbb{R}\setminus\{0\}$ is the set of all non-zero real numbers.2011-09-15
  • 0
    It's really only $2^{2^\omega-1}$, since the apparent choice is illusory in the case of $x=0$.2012-10-08
3

If $f$ doesn't have to be continuous, you can just choose $f(x)$ to be $|x|$ or $-|x|$ arbitrarily at each $x$, so there are lots of possibilities for $f$ (most of which I would not describe as "piecewise" combinations of the 4 continuous solutions).

  • 0
    This is pretty much the answer I was looking for (it's exactly "my level") and I'd love to vote it the answer, but Brian's ended up being more complete and the one that's probably most widely useful. Thanks!2011-09-15
3

Let $s$ be an arbitrary function $\mathbb{R}\to\{-1,+1\}$. Then $f=s\cdot\mathrm{id}$ satisfies the property: $(s(x)x)^2=x^2$. Indeed, this exhausts all possible functions, as $s$ can be constructed by looking at $x/f(x)$ (and making an arbitrary choice when $x=0$).

There are uncountably many of these functions, in fact $2^\mathfrak{c}$ where $\mathfrak{c}=2^{\aleph_0}$ is the cardinality of the continuum.