Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Show that there are no functions $f: \mathbb R \to \mathbb R$ which have the Darboux property (the intermediate value property) and $f(f(x))=\cos^2(x) ; \ \forall \ x\in \mathbb R$.

I guess that I'd have to use the fact that $f(f(x)) \in [0,1]$, but I'm not sure how

share|cite|improve this question
If you google "f(f(x)) math overflow" you might get some hints. – NikolajK Mar 30 '13 at 11:50
Ok I give up >_<. Here are the few things I found in case it rings a bell: $\forall \ x\in \Bbb R,f(f(x))=\cos^2(x)\space\space\space\space\space\space\space\space\space\space$ $\forall x \in \Bbb R, f(f(x))\in [0,1]\space\space\space\space\space\space\space\space\space\space$ $\forall x \in \left[0,\cfrac{\pi}{2}\right], f(f(x))=\cos^2(x) \Leftrightarrow \cos(x)=\sqrt{f(f(x))} \Leftrightarrow x=\arccos \left(\sqrt{f(f(x))}\right)\space\space\space\space\space\space\space\space$ So $f$ is injective on $\left[0,\cfrac{\pi}{2}\right]$ – xavierm02 Mar 30 '13 at 12:50
$\forall x \in \Bbb R, \cos^2(f(x))=f(f(f(x)))=f(\cos^2(x))\space\space\space\space\space$ $f(1)=\cos^2(f(0))\space\space\space\space\space$ $f(0)=\cos^2\left(f\left(\cfrac{\pi}{2}\right)\right)$ – xavierm02 Mar 30 '13 at 12:51
did you find out how in the meantime? i completed my answer, let me know your thoughts – suissidle Apr 6 '13 at 12:46
up vote 4 down vote accepted

ok so i took this with me on easter and found a proof. i'll post more details later, first only a few hints to get you started. as you already found out, $f|_{[0,\frac{\pi}{2}]}$ is injective; actually, for each $n\in\mathbb{Z}$, $f|_{[n\frac{\pi}{2},(n+1)\frac{\pi}{2}]}$ is injective. using the IVP, show that each $f|_{[n\frac{\pi}{2},(n+1)\frac{\pi}{2}]}$ is continuous, hence $f$ must be continuous everywhere. show that without loss of generality we can assume $f\ge0$ and $f(-x)=f(x)$. show $f$ is periodic with period $\pi$ (so $f$ attains its maximum and minimum at the endpoints of each $[n\frac{\pi}{2},(n+1)\frac{\pi}{2}]$) and a few more things to derive a contradiction using $x=0$ and $x=\frac{\pi}{2}$. you may or may not need the fact that $f$ has exactly one fixed point $x^*$, and $x^*\in(0,1)$, and $x^*$ is also a fixed point of $\cos^2(x)$

EDIT A solution is a function that satisfies andreea's problem (we want to prove that no such exists). Let $f$ denote any solution, unless stated otherwise. IVP stands for intermediate value property, and monotone refers to either monotonically increasing or monotonically decreasing.

Lemma 1 Let $J$ be any set, $I\subseteq J$ any subset, and $f:J\rightarrow J$ any function. Then

$$(f\circ f)|_I \quad \text{is injective} \quad \Longrightarrow \quad f|_I \quad \text{is injective.}$$

Proof Suppose $(f\circ f)|_I$ is injective, $x,y\in I$, and $f(x)=f(y)$. Then $f(f(x))=f(f(y))$, hence $x=y$.

Take $J=\mathbb{R}$, $n\in\mathbb{Z}$, $I=[n\frac{\pi}2,(n+1)\frac{\pi}2]$. Since $f\circ f=\cos^2$ and $\cos^2|_{[n\frac{\pi}2,(n+1)\frac{\pi}2]}$ is injective, this yields:

Proposition 1 $f|_{[n\frac{\pi}2,(n+1)\frac{\pi}2]}$ is injective.


Proposition 2 $f|_{[n\frac{\pi}2,(n+1)\frac{\pi}2]}$ is strictly monotone.

Proof Suppose $f(n\frac{\pi}2)<f((n+1)\frac{\pi}2)$. We'll show that $f|_{[n\frac{\pi}2,(n+1)\frac{\pi}2]}$ is strictly monotonically increasing.

Take $x,y\in(n\frac{\pi}2,(n+1)\frac{\pi}2)$ such that $x<y$. Suppose $f(x)>f(y)$. Note that $$ f(x)>\max\{f(n\frac{\pi}2),f(y)\}\quad\text{or}\quad f(y)<\min\{f(x),f((n+1)\frac{\pi}2)\} $$ where the left equality holds whenever $f(n\frac{\pi}2)<f(x)$, and the right one whenever $f(y)<f((n+1)\frac{\pi}2)$ (there's some overlap, but this has no influence on the proof). In the 'left' case, by the IVP, $f$ must touch $\max\{f(n\frac{\pi}2),f(y)\}$ at least twice on $[n\frac{\pi}2,y]$, in contradiction to injectivity. In the 'right' case, the same applies to $\min\{f(x),f((n+1)\frac{\pi}2)\}$. Hence necessarily $f(x)<f(y)$.

Analogously, if $f(n\frac{\pi}2)>f((n+1)\frac{\pi}2)$ then $f|_{[n\frac{\pi}2,(n+1)\frac{\pi}2]}$ is strictly monotonically decreasing.


Lemma 2 Let $a,b\in\mathbb{R}$, and $f:[a,b]\rightarrow\mathbb{R}$ be a strictly monotone function with the IVP. Then $f$ is continuous.

Proof Without loss of generality, assume $f$ is increasing; otherwise take $-f$, since 'taking the negative' doesn't influence continuity. Choose $x\in[a,b]$ and $\epsilon>0$. Note that, by the IVP, there exist $x_-,x_+\in[a,b]$ such that $$ f(x_-)=\min\{f(x)-\epsilon, f(a)\} \quad \text{and} \quad f(x_+)=\min\{f(x)+\epsilon, f(b)\}$$ Set $\delta=\min\{|x-x_-|,|x-x_+|\}\backslash\{0\}$ (i.e. we ignore the $x_-$ or $x_+$ term if $x_-=f(a)$ or $x_+=f(b)$, respectively). Then, for any $y\in(x-\delta,x+\delta)\cap[a,b]$, by monotonicity, $$ f(x_-)\le f(y)\le f(x_+) $$ hence $$ f(x)-\epsilon<f(y)<f(x)+\epsilon\text. $$

Take $a=n\frac{\pi}2$, $b=(n+1)\frac{\pi}2$. Then $f|_{[n\frac{\pi}2,(n+1)\frac{\pi}2]}$ is continuous. In particular, $f(x)$ is both left continuous and right continuous at $x=n\frac{\pi}2$, for any $n\in\mathbb{Z}$, and we get:

Proposition 3 $f$ is continuous.

Note that, for any $x\in\mathbb{R}$, $$ f(\cos^2(x)) = \cos^2(f(x)) \in [0,1] $$ Thus we can define the (continuous) function $\tilde f:\mathbb{R}\rightarrow[0,\pi]$ by $$ \tilde f(x)=\arccos\sqrt{f(\cos^2(x))} $$ It is easy to see that $g$ is also a solution: $$ \tilde f(\tilde f(x)) = \arccos\sqrt{f(\cos^2(\arccos\sqrt{f(\cos^2(x))}))} \\ = \arccos\sqrt{f(f(\cos^2(x)))} \\ = \arccos\sqrt{\cos^2(\cos^2(x))} \\ = \cos^2(x) $$ Without loss of generality, assume henceforth that $f=\tilde f$. This gives:

Proposition 4

  • $f$ is nonnegative
  • $f$ is even
  • $f$ is periodic with period $\pi$.

Note that $f(f(\frac{\pi}2))=0$, so $0\in\operatorname{im}f$ ; by periodicity and monotonicity, $f$ attains the value $0$ at one endpoint of each interval $[n\frac{\pi}2,(n+1)\frac{\pi}2]$. Focusing on the interval $[0,\frac{\pi}2]$, we have two cases:

  1. $f(0)=0$, or
  2. $f(\frac{\pi}2)=0$

If (1.), then $$ 0 = f(0) = f(f(0)) = \cos^2(0) = 1 \text; $$ if (2.), then $$ 0 < f(0) = f(f(\frac{\pi}2)) = \cos^2(\frac{\pi}2) = 0 \text; $$ both contradictions. We conclude that no such $f$ exists.

share|cite|improve this answer
i completed my answer, feel free to comment on it – suissidle Apr 6 '13 at 12:45
An injective monotone function is clearly strictly monotone. So in propositon 2 it may be simpler to prove $f$ is just monotone. Also lemma 2 can be simplifies using the fact that a monotone function has countable number of (jump) discontinuities. – user59671 Apr 9 '13 at 10:06
in the proof of prop 2 i'm just assuming injectivity throughout (my usage of $<$ instead of $\le$ etc); i know it's worded in a convoluted way but that's because it summarizes the cases to be checked; i don't see how dropping the 'strictness' would make it simpler. as to lemma 2, i don't see why it matters how many discontinuities there are, although it's important to see that all discontinuities are jumps; in the proof i implicitly showed the existence of left and right limits. – suissidle Apr 9 '13 at 10:32
btw i only realized the utility of $\tilde f$ later on, and maybe all the workup to show continuity of $f$ isn't necessary (just show that $\tilde f$ has the IVP, or that the IVP is conserved by composing with continuous and injective functions) although it was perversely interesting to find out all the properties $f$ (which doesn't exist anyway) has to satisfy – suissidle Apr 9 '13 at 10:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.