Question. Which of the following statements are true:

  1. If $f \in C[0,2]$ is such that $f(0)=f(2)$, then there exist $x_1$ and $x_2$ in $[0,2]$ such that $x_1-x_2=1$ and $f(x_1)=f(x_2)$.

  2. Let $f$ and $g$ be continuous real valued functions on $\mathbb{R}$ such that for all $x\in \mathbb{R}$, we have $f(g(x))=g(f(x))$. If there exists $x_0 \in \mathbb{R}$ such that $f(f(x_0))=g(g(x_0))$, then there exists $x_1\in \mathbb{R}$ such that $f(x_1)=g(x_1)$.

My Attempts.

  1. Here $f(0)=f(2)$. If $f(1) \ne f(0)$, say, $f(1)>f(0)$ then for any $k$ such that $f(0)<k<f(1)$ there exists a $x_1,x_2$ with $0<x_1<1$ and $1<x_2<2$ such that $f(x_1)=f(x_2)=k$ (by Intermediate Value Property of $f$). But how can I prove $x_2-x_1=1$? Please help.

  2. I don't have any guess here to start...


2 Answers 2


For 1) you can consider :

$$ g(x) = f(x+1) - f(x)$$

$g$ is continuous and verify :

$$ g(1) = f(2) - f(1) = f(0) - f(1) = -(f(1) - f(0)) =-g(0)$$

Then $g$ sign is changing and by the intermediate value theorem you can such $x_1$ and $x_2$. Using the same idea for 2) you'll have the result.

For 2), pose $h(x) = f(x) - g(x)$. Using the hypothesis :

\begin{align*} h(f(x_0)) &= f(f(x_0)) - g(f(x_0)) \\ &=g(g(x_0)) - f(g(x_0)) \\ &= -h(g(x_0)) \end{align*}

So it means that $h$ sign is changing and since $h$ is continuous, the intermediate value theorem gives you that you can find $x_1$ such as $h(x_1) = f(x_1) - g(x_1) =0$.

  • 4
    $\begingroup$ Anyway, it's a nice exercise, and a great answer. OP should accept it as the best answer. $\endgroup$ Aug 21, 2018 at 12:34
  • $\begingroup$ @NicolasFRANCOIS It is very nice of you to say that! $\endgroup$
    – amsmath
    Aug 21, 2018 at 12:38
  • $\begingroup$ Q1 is the case n=2 of the Horizontal Chord Theorwm: If $a<b$ and $f:[a,b]\to \Bbb R$ is continuous with $f(a)=f(b)$ then for any $n\in \Bbb N$ there exists $u,v\in [a,b]$ with $|u-v|=(b-a)/n$ and $f(u)=f(v)$. Proof: For $x\in [a, b-(b-a)/n]$ let $g(x)=f(x)-f(x+(b-a)/n).$ If $g$ were always positive or always negative then $0\ne$ $ \sum_{j=0}^{n-1} g(a+j(b-a)/n)=$ $f(a)-f(b)=0.$ $\endgroup$ Aug 21, 2018 at 18:58

As always in this kind of problems, to use intermediate values theorem, you have to convert your "equation" in the form $g(x)=0$. Here you have $f(x+1)=f(x)$, so let $g:x\mapsto f(x+1)-f(x)$ be defined on interval $[0,1]$.

You have $g(0)=f(1)-f(0)$, $g(1)=f(2)-f(1)$, so $g(0)+g(1)=f(2)-f(0)=0$.

Either $g(0)$ and $g(1)$ are both $0$ (in which case you have found TWO solutions to your problem), or they are non null opposite. As $g$ is continuous, you can apply IVT to $g$ to prove existence of a solution.

A note : with a little bit of work, you can generalize the result : for every fraction $\frac2n$ of the complete interval, you can find two points distant of this fraction where $f$ takes the same value.

For example, if you run $10$ miles in an hour, there is a quarter of an hour where you actually ran $2.5$ miles.

  • $\begingroup$ @Nicola...can you please tell me the general statement more precisely in your note...I don't get that general one... $\endgroup$
    – sigma
    Aug 21, 2018 at 11:54
  • 1
    $\begingroup$ This is what I mean : for any positive integer $n$, there exists two points $x_1^{(n)}$ and $x_2^{(n)}$ such that $x_2^{(n)}-x_1^{(n)}=\frac1n$ and $f\left(x_1^{(n)}\right)=f\left(x_2^{(n)}\right)$ (it's a result from Paul Levy). $\endgroup$ Aug 21, 2018 at 11:57
  • $\begingroup$ @Nicolas..What is $f$..? Is $f\in C[0,2]$? $\endgroup$
    – sigma
    Aug 21, 2018 at 12:00
  • $\begingroup$ Yes, as in your initial post. $\endgroup$ Aug 21, 2018 at 12:00
  • $\begingroup$ Does $[0,2]$ is necessary...I mean what about any $[a,b]$ ? $\endgroup$
    – sigma
    Aug 21, 2018 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .