# Example of a function that is continuous at $c$ whose inverse is discontinuous at $f(c)$

I'd like an example of a function $$f:(a,b)\to\mathbb R$$ and a point $$c\in(a,b)$$ such that:

• $$f$$ is invertible.
• $$f$$ is continuous at $$c$$.
• $$f^{-1}$$ is discontinuous at $$f(c)$$.

Motivation: There is a calculus book that states the following.

Let $$f$$ be an invertible function defined on an interval $$I$$. If $$f$$ is differentiable at $$c\in I$$ and $$f'(c)\neq 0$$, then $$f^{-1}$$ is differentiable at $$f(c)$$.

In the proof, the continuity of $$f^{-1}$$ at $$f(c)$$ is essential. Usually, the said essential fact is an hypothesis (if the domain is not an interval) or it is implied by the hypothesis that $$f$$ is continuous in a neighborhood of $$c$$ (if the domain is an interval). But in the said book, both hipothesis are missing and the fact is justified as follows:

As $$f$$ is differentiable at $$c$$, $$f$$ is continuous at $$c$$. Therefore, $$f^{-1}$$ is continuous at $$f(c)$$.

I suspect continuity at $$c$$ does not imply continuity of the inverse at $$f(c)$$ due to the following facts:

1. It seems it is not a common result in analysis books.
2. In the usual proofs that the inverse of a continuos map (on an interval or on a compact set) is continous, in order to prove that the inverse is continuous at a given point, we need the continuity of $$f$$ in the whole domain.
3. In more recent editions of the said book, the statement was modified (now, it is supposed that $$f$$ is differentiable in a neighborhood of $$c$$, which implies what is needed).

However, I do not have a counterexample.

• Does this help? math.stackexchange.com/questions/362592/… Feb 20 at 23:14
• this is the one variable case, so if f is continuous its inverse is continuous too. Look this https://proofwiki.org/wiki/Continuous_Inverse_Theorem
– tac
Feb 20 at 23:19
• @AndrewZhang My question is different. I'm talkin about continuity at a single point of an interval. Thus, $f$ and $f^{-1}$ cannot be continuous (in the whole domain). Feb 20 at 23:21
• @tac I'm not talking about continuous functions (in the entire interval). See my previous comment. Also, I referred to the linked result in item 2 of my question. Feb 20 at 23:22
• @Taladris Not even. That's true if $f$ is continuous on an interval. But it can be defined on an interval and continuous at just one point. See my answer Feb 20 at 23:44

Here is an example of such a function. It comes from the book Les contre-exemples en mathématiques by Bertrand Hauchecorne (more precisely, section 8.22, page 150, in the second edition).

Consider $$g\colon \Bbb R_+ \to \Bbb R_+$$ defined by $$g(x) = \begin{cases} \frac{n}{2} & \text{if} \quad x=n \quad \text{is an even integer},\\ \frac{1}{n+2} & \text{if} \quad x=n \quad \text{is an odd integer},\\ \frac{1}{2(n-1)} & \text{if} \quad x=\frac{1}{n} \quad \text{with} \quad n \geqslant 2 \quad \text{integer},\\ x & \text{in any other case}. \end{cases}$$ Now, consider $$f\colon \Bbb R \to \Bbb R$$ defined as $$f(x) = \begin{cases} g(x) & \text{if} \quad x \geqslant 0,\\ -g(-x) & \text{if} \quad x < 0. \end{cases}$$ One shows with a bit of effort that $$f$$ is a bijection.

Note that $$|f(x)| \leqslant |x|$$ for all $$x$$, so that $$f$$ is continuous at $$0$$ with $$f(0)=0$$. However, for all $$n \geqslant 1$$, $$f(2n-1) = \frac{1}{2n+1}$$ shows that $$f^{-1}\left(\frac{1}{2n+1}\right) = 2n-1 \underset{n \to \infty}{\longrightarrow} \infty$$, so that $$f^{-1}$$ is not continuous at $$0$$.

• Amazing source. Feb 20 at 23:47
• @Pedro I was advised to read this book while I was in my first or second year as a student, and that's one of the best advices I've been given ever since. Feb 20 at 23:50
• (+1) Et est-ce qu'il existe un contre-exemple avec en plus $f'(0)$ existe et $\ne0?$ Feb 21 at 0:16
• @AnneBauval Très bonne question. À cette heure-ci, je ne saurais répondre Feb 21 at 0:23
• @AnneBauval: Oui ! See the answer that I've posted. Feb 21 at 10:33

Here's a bijection $$f$$ from the interval $$(-2,2)$$ to the interval $$(-\frac32,\frac32)$$, such that $$f$$ is continuous at $$0$$, and in fact even differentiable there with $$f'(0)=1$$, but $$f^{-1}$$ is discontinuous at $$f(0)=0$$.

Define $$f$$ on the interval $$(-1,1)$$ by $$f(0) = 0$$ and $$f(x) = \left( 1 + \frac{1}{n} \right) x ,\quad\text{for}\quad \frac{1}{n} \le |x| < \frac{1}{n-1} \quad (n = 2,3,\dots) .$$ For $$1 \le |x| < 2$$, define $$f$$ in a piecewise linear way, such that it assumes precisely those values that it previously jumped over, as indicated by this picture: • Very nice. The picture is illuminating. Feb 21 at 11:23
• What a nice example! Feb 21 at 12:06