Is it true that if $f(f(x))$ is continuous and strictly decreasing then $f$ is continuous$?$

Is it true that if $$f(f(x))$$ is continuous and strictly decreasing then $$f$$ is continuous$$?$$

First of all, how can $$f(f(x))$$ be strictly decreasing. If $$f(x)$$ is increasing then $$f(f(x))$$ is also increasing and if $$f(x)$$ is decreasing, then $$f(f(x))$$ is increasing again.

I think this statement is trivially true. If we use Boolean algebra, if $$p$$ is not true then $$p \Rightarrow q$$ is always true.

Am I thinking correctly$$?$$

What if $$f(x)$$ is neither increasing nor decreasing.

The answer is NO. Indeed, here is a counterexample.

First, partition the interval $$(0,\infty)$$ into pairs of two elements.

This can be done for example, by paring $$x \in (0, \infty)$$ with $$\frac{1}{x}$$, as long as they are both not integers, and pairing $$n$$ with $$\frac{1}{n+1}$$ (the last one to avoid the fact that $$x=\frac{1}{x}$$ for $$x=1$$).

This way, we get a family $$\{ A_i\}_{i \in I}$$ of sets, with the following properties:

• $$|A_i|=2$$ for each $$i$$.
• $$A_i \cap A_j= \emptyset$$ for all $$i \neq j$$.
• $$\bigcup_{i \in I} A_i =(0,\infty)$$.

Now, define $$f: \mathbb R \to \mathbb R$$ the following way: First set $$f(0)=0$$.

Next, for each $$i \in I$$, if $$A_i=\{ a,b\}$$ define $$f(a)=b \\ f(b)=-a \\ f(-a)=-b \\ f(-b)=-a$$

Then $$f \circ f(x)=-x$$ for all $$x \in \mathbb R$$.

By chosing the right $$A_i$$ you can make $$f$$ discontinuous, but $$f \circ f$$ is continuous and decreasing.

P.S. A simpler way to pair $$(0, \infty)$$ is by pairing the intervals $$(2n, 2n+1]$$ and $$(2n+1, 2n+2]$$ via the $$x \to x+1$$.

Then, if I didn't make a mistake, here is your function $$f(x)= \left\{ \begin{array}{lc} f(0)=0 & \\ f(x)=x+1 & \mbox{ if } \lceil x \rceil \mbox{ is positive and odd } \\ f(x)=-x+1 & \mbox{ if } \lceil x \rceil \mbox{ is positive and even} \\ f(x)=x-1 & \mbox{ if } \lfloor x \rfloor \mbox{ is negative and odd} \\ f(x)=-x-1 & \mbox{ if } \lfloor x \rfloor \mbox{ is negative and odd} \\ \end{array} \right.$$

Here $$\lceil x \rceil$$ and $$\lfloor x \rfloor$$ are the ceiling and floor functions.

Added Note that actually you can prove something simpler, and probably this is what the question asks:

Lemma If $$f \circ f$$ is strictly decreasing, then $$f$$ cannot be continuous on $$\mathbb R$$.

Proof: Assume by contradiction that $$f$$ is continuous. Since $$f\circ f$$ is one to one, $$f$$ must be a one-to-one function.

Since $$f$$ is one-to-one and continuous, by a simple application of the Intermediate value Theorem it is monotonic.

But then, by the argument you made $$f$$ is increasing, contradiction.

• I am confused isn't by this rule for instance $\{1/2, 2\}$ and $\{2, 1/3\}$ happening? Since $1/2$ is no integer and then because 2 is? Also you really want $f(b) = -a$? Because I don't think that is well-defined. Sep 24, 2019 at 3:18
• @hal4math For the first point, there was a typo, I fixed it. I mean when $x$ and $\frac{1}{x}$ are not integers. For the second, remember that I am defining a function from $\mathbb R$ to $\mathbb R$. Sep 24, 2019 at 4:02
• Ah, okay. But lets say I have now $x\in\mathbb{R}$, $x > 0$ and I find $A$ with $x$ in it and so is say $y$. Is $f(x) = y$ or $f(x) = - y$? I think I can't tell from your definition. Sep 24, 2019 at 4:23
• @hal4math You have to make a choice, which is irrelevant, but needs to be made. Note that if you chose $f(x)=y$ then $f(y)=-x$ while if you make the other choice $x, y$ get interchanged, i.e $f(x)=-y$ and $f(y)=x$...... Sep 24, 2019 at 5:33
• @hal4math If you what to make a consistent choice, you can simply say: order $a <b$ and then use the four cycle $a \to b \to -a \to -b$ and back to $a$, i.e. smaller goes to the other, and larger goes to negative. Sep 24, 2019 at 5:36