How to prove that $f(f(x))=-x$ implies that $f$ is not continuous? [duplicate]

I am trying to prove that: Given an $f:\mathbb{R} \rightarrow \mathbb{R}$, if $f(f(x))=-x$ then $f$ is not continuous?

any help?

Thank you!


Solution 1:

First, $f$ is a bijection, since otherwise we would have for $x \neq y$, $f(x)=f(y)$ then $-x=f(f(x))=f(f(y))=-y$, contradiction.

Now, a continuous bijection from $\mathbb{R}$ to $\mathbb{R}$ is monotone.

Let's pretend it's increasing, and $x<y$. Then $f(x)<f(y)$, and $f(f(x))<f(f(y))$ thus $-x<-y$ and $x>y$, contradiction.

Thus it must be decreasing, but then, for $x<y$, $f(x)>f(y)$, then $f(f(x))<f(f(y))$, thus $-x<-y$, and $x>y$. Again a contradiction.

Therefore, your function cannot be continuous.

Solution 2:

The general argument goes like this.

[assertion 1] Given any two functions $\varphi : U \to V, \psi : V \to W$, we know:

  • If $\psi \circ \varphi$ is injective, then $\varphi$ is injective.
  • If $\psi \circ \varphi$ is surjective, then $\psi$ is surjective.

    So for any $f : \mathbb{R} \to \mathbb{R}$ such that $f(f(x)) = -x$, $f \circ f$ bijective implies $f$ bijective.

[assertion 2] If $f$ is continuous and bijective, then it will either be a strictly monotonic increasing or a strictly monotonic decreasing function.

[assertion 3] In both cases, $f\circ f$ will be strictly monotonic increasing.

[conclusion] Since the function $x \mapsto -x$ isn't, $f$ cannot be continuous.

The same argument shows that for any $g : \mathbb{R} \to \mathbb{R}$, if $g \circ g$ is strictly montonic decreasing and bijective, then $g$ cannot be continuous.

Can you convince yourselves why assertions 1, 2, 3 are true?