Example of function that is differentiable at $0$, and has inverse function that is not continuous at $0$? Is there any example of a function $f(x)$ differentiable at $x=0$, with an inverse function that is not continuous when $x=0$? Any help where to start, or maybe even if someone has the example of such a function would be greatly appreciated.
 A: For $n\in\mathbb N$, let $A_n$ be sets with the following properties:


*

*$A_n$ is uncountable, 

*$0\notin A_n$,

*$0\in \overline{A_1}$

*$A_n\cap A_k=\emptyset$ for $k\ne n$.

*$(-1,-\frac1{n^2}]\cup[-\frac1{n^2},1)\subseteq \bigcup_{k< n}A_k$


One can write such a partition down explicitly (see below), but I'm afraid the formalism might hide theses four essential properties.
For each $n$, let $$f_n\colon \left(-\tfrac1n,-\tfrac1{n+1}\right]\cup\left[\tfrac1{n+1},\tfrac1n\right)\to A_n$$
be any bijection and let 
$$f(x)=\begin{cases}0&\text{if }x=0\\f_n(x)&\text{if }\frac1{n+1}\le |x|<\frac1n\end{cases}$$
Then $f\colon(-1,1)\to(-1,1)$ is a bijection. Let $g$ be its inverse.
If $\frac1{n+1}\le |x|<\frac1n$, we have $f(x)\in A_n$, hence $|f(x)|<\frac1{n^2}\le (1+\frac1n)^2|x|^2\le 4|x|^2$, hence $f'(0)=0$.
But $g$ is not continuous: Of course $g(0)=0$. But if $\epsilon>0$, because $0$ is a limit point of $A_1$, there are $x$ with $|x|\ge \frac12$ and $f(x)<\epsilon$. Hence there are $x$ with $|x|<\epsilon$ and $|g(x)|\ge \frac12$.

Here's an explicit description of $A_n$:
$$A_1=\left\{x\in\mathbb (-1,1)\mid x\ne 0, \left\lceil \tfrac1{|x|}\right\rceil\le4\text{ or even}\right\}$$
$$A_n=\left\{x\in\mathbb (-1,1)\mid x\ne 0, n^2<\left\lceil \tfrac1{|x|}\right\rceil\le(n+1)^2\text{ and odd}\right\}\quad\text{if }n\ge2$$
A: Unless there are more conditions that you're not sharing, then $f(x)=e^x$ is such a function. Its inverse function $g(x)=\ln x$ isn't even defined at $x=0$, much less continuous there.
A: Let $f(x)$ be the pdf of a standard lognormal distribution and $x=a$ be its mode. The domain of $f$ is $(0,\infty)$, but let us also define $f(0)=0$. Then the right hand derivative of $f$ at zero is zero. Now, let
\begin{align}
Q &= f^{-1}(\mathbb{Q}),\\
Q^c &= f^{-1}(\mathbb{R}\setminus\mathbb{Q}) = \mathbb{R}^+\setminus Q,\\
g(x) &=\begin{cases}
f(x) &\textrm{ if } x\in [0,a]\cap Q,\\
-f(x) &\textrm{ if } x\in [0,a]\cap Q^c,\\
f(x) &\textrm{ if } x\in (a,\infty)\cap Q^c,\\
-f(x) &\textrm{ if } x\in (a,\infty)\cap Q.\\
\end{cases}
\end{align}
Then $g(0)=g'(0)=0$ and $g$ has an inverse, but $g^{-1}$ is not continuous at $0$ because $\lim_{x\rightarrow\infty}g(x)=0=g(0)$.
A: WLOG we will asssume $f(0) = 0$ and $f'(0) = 0$.
Recall that if the function $f$ is continuous in a neighborhood of $0$ then it is either monotonic (in which case it has a continuous inverse) or non monotonic (in which case it fails to be injective). So our $f$ needs to be continuous (and differentiable) in $0$ but not in any neighborhood of $0$.
We want $f^{-1}$ not to be continuous in $f(0) = 0$, meaning that there must exist $\varepsilon>0$ such that for any $\delta >0$ there is a $x$, with $|x| < \delta$, for which $|f^{-1}(x)|\geq \varepsilon$.
Translating this into a requirement on $f$ yields the following. There exists $\varepsilon > 0$ such that, for each $\delta > 0$ we can find a $|x|\geq \varepsilon$ that gives $|f(x)| < \delta$. In other words, we want $f(x)$ to attain arbitrarly small values, for 'large enough' values of $x$, which is not in contradiction with the requirement on $f$ we have in our hypotheses. The hardest part of the requirement is that of obtaining a function which has the above mentioned property and yet is injective.
We will construct a bijective function $f: [-2,2] \to [-2,2]$ by first creating a function $g$ that satisfies the requirements for $0\leq x \leq 2$ and then get $f$ by simmetry.
We will start by letting, for $0\leq x \leq 1$, $$g_1(x) = p(x)= x^2,$$ which has the required properties save for the fact that its inverse is continuous in $0$, and force our modification of $g_1$ to lie within the parabola and the cubic function
$$c(x) = x^3.$$
We create the first 'hole' in $g_1$ at $2^{-1}$ by letting
$$g_1\left(2^{-1}\right) =  c\left(2^{-1}\right) = 2^{-3}.$$
This action frees $2^{-2}$ that later on will be used as image of a larger value of $x$.
In order to preserve injectivity we now have to modify the image of $2^{-3/2}$. Again we remap this point using $c$, which yields
$$g_1\left(2^{-3/2}\right) = c\left(2^{-3/2}\right)=c\circ p^{-1} \circ c\left(2^{-1}\right) = 2^{-9/2}. $$
This process must be repeated indefinitely by letting, for $n=0,1,2\dots$,
$$g_1\left(t^{(n)}\left(2^{-1}\right)\right)=c\left(t^{(n)}\left(2^{-1}\right)\right),$$
where
$$t(x) = p^{-1} \circ c(x),$$
and
$$t^{(n)}(x) = \underbrace{t\circ t \circ \cdots \circ t}_{n} (x)$$
for $n>0$, and $t^{(0)}(x) = x$.
Now, as mentioned earlier, we have room to let $g(x) = 2^{-2}$ for some $1<x \leq 2$. Fixing $g\left(2-2^{-2}\right) = 2^{-2}$ yields the scenario depicted below, where
$$r : r(x) = 2-x.$$

Now we can go back to the neighborhoods of $0$ and start another iteration at $3^{-1}$. Using the sequence of primes $p_k$, $k=1,2,\dots$ prevents any 'interference' between different iterations. Hence we have, for $0\leq x \leq 1$,
$$g_1(x)=
\begin{cases}
c(x) & \left(x=t^{(n)}\left(p_k^{-1}\right), \ \mbox{for some} \ k>0 \ \mbox{and some} \ n>0\right)\\
p(x) & (\mbox{otherwise}).
\end{cases}
$$
Note that $g_1$ is injective (what is its range?).
Finally me make the domain compact and connected by means of a reflection with respect to line $r$. As a result we have
$$
g(x) = 
\begin{cases}
g_1(x) & (0\leq x \leq 1)\\
p_k^{-2} & \left(x = 2-p_{k}^{-2},\mbox{for some}\ k>0\right)\\
2-g_1^{-1}(2-x) & (\mbox{otherwise}).
\end{cases}
$$
The result after a few iterations on $k$ is sketched below.

Now the required $f$ is
$$
f(x) = 
\begin{cases}
g(x) & (0\leq x \leq 2)\\
-g(-x) & (-2\leq x <0).
\end{cases}
$$
A final note. The reader can easily verify that $f(x)$ is differentiable almost everywhere, i.e. at all points $-2 < x <2$ such that $f(x) = \pm p(x)$.
