Maths WorkshopMaths problems with full solutions
Exercise 114Calculus › Single-variable calculus › Continuity › Functional equationsL1Added 7 Nov 2026

A continuous f with f o f= cos cannot exist

#functional equation#cosine#continuity#monotonicity

Statement

Let f:R→Rf:\mathbb{R}\to\mathbb{R} satisfy f∘f=cos⁡f\circ f=\cos. Show that ff is not continuous on R\mathbb{R}.

Hint

First show that ff commutes with cos⁡\cos. Then focus on the interval J=[cos⁡1,1]J=[\cos 1,1], where cos⁡\cos is strictly decreasing and maps JJ into itself. Assume ff continuous on JJ and derive a contradiction from the monotonicity of ff and f∘ff\circ f.

Show solutionHide solution

Solution

Step 1: ff commutes with cos⁡\cos. Composing f∘f=cos⁡f\circ f=\cos on the left and on the right by ff:
f∘cos⁡=f∘(f∘f)=(f∘f)∘f=cos⁡∘f.f\circ\cos=f\circ(f\circ f)=(f\circ f)\circ f=\cos\circ f.
So f(cos⁡x)=cos⁡(f(x))f(\cos x)=\cos(f(x)) for every x∈Rx\in\mathbb{R}.

Step 2: ff sends [−1,1][-1,1] into [−1,1][-1,1]. Since cos⁡(R)=[−1,1]\cos(\mathbb{R})=[-1,1], for y∈[−1,1]y\in[-1,1] we have y=cos⁡xy=\cos x for some xx, hence y=f(f(x))∈f(R)y=f(f(x))\in f(\mathbb{R}). Thus
f([−1,1])=f(cos⁡R)=cos⁡(f(R))⊆[−1,1].f([-1,1])=f(\cos\mathbb{R})=\cos(f(\mathbb{R}))\subseteq[-1,1].

Step 3: consider J=[cos⁡1,1]J=[\cos1,1]. Since 0<cos⁡1<10<\cos1<1, the map cos⁡\cos is strictly decreasing on [0,1][0,1], hence on J⊆[0,1]J\subseteq[0,1]. Moreover cos⁡(J)⊆J\cos(J)\subseteq J: for x∈Jx\in J, x≤1x\le 1 gives cos⁡x≥cos⁡1\cos x\ge\cos1, and x≥cos⁡1≥0x\ge\cos1\ge0 gives cos⁡x≤1\cos x\le 1. So cos⁡\cos maps JJ into JJ, strictly decreasing.

Step 4: ff is injective on JJ. If x,y∈Jx,y\in J and f(x)=f(y)f(x)=f(y), then cos⁡x=f(f(x))=f(f(y))=cos⁡y\cos x=f(f(x))=f(f(y))=\cos y. Since cos⁡\cos is injective on JJ, x=yx=y. Hence f∣Jf|_J is injective.

Step 5: contradiction if ff is continuous. Suppose ff continuous. Then f∣Jf|_J is continuous and injective on the interval JJ, hence strictly monotonic on JJ.

  • If f∣Jf|_J is increasing, then for x<yx<y in JJ: f(x)<f(y)f(x)<f(y), so f(f(x))<f(f(y))f(f(x))<f(f(y)), i.e. cos⁡x<cos⁡y\cos x<\cos y. But cos⁡\cos is decreasing on JJ, so x<y⇒cos⁡x>cos⁡yx<y\Rightarrow\cos x>\cos y — contradiction.
  • If f∣Jf|_J is decreasing, then for x<yx<y: f(x)>f(y)f(x)>f(y), so f(f(x))<f(f(y))f(f(x))<f(f(y)), i.e. cos⁡x<cos⁡y\cos x<\cos y. Again, cos⁡\cos decreasing on JJ gives cos⁡x>cos⁡y\cos x>\cos y — contradiction.

So ff cannot be continuous on JJ, hence ff is not continuous on R\mathbb{R}.