Setting:
Let $a\in \mathbb{R}$, and let $f$ be a function which is continuous on $\mathbb{R}$, differentiable on $(\infty,a)\cup (a,\infty)$, and has the property that $\lim_{x\to a^{-}}f'(x) = \lim_{x\to a^{+}}f'(x) = L$ for some $L\in\mathbb{R}$.
Question:
Does it automatically follow that $f$ is differentiable at $a\in \mathbb{R}$?
My intuition wants to say yes since we are placing such strong conditions on $f$, and if I were going to try to prove this I would pursue the following logic:
Argument:
\begin{align*} f'(a) &= \lim_{h\to 0}\frac{f(a+h) - f(a)}{h}\\ &= \lim_{h\to 0}\left[\lim_{x\to a^{-}}\frac{f(x+h) - f(x)}{h}\right]\text{using continuity of} f \text{at }a\\ &= \color{red}{\lim_{x\to a^{-}}\left[\lim_{h\to 0}\frac{f(x+h) - f(x)}{h}\right]}\\ &= \lim_{x\to a^{-}}f'(x)\\ &= L \end{align*}
or using essentially the same argument from the other side.....
\begin{align*} f'(a) &= \lim_{h\to 0}\frac{f(a+h) - f(a)}{h}\\ &= \lim_{h\to 0}\left[\lim_{x\to a^{+}}\frac{f(x+h) - f(x)}{h}\right]\text{using continuity of} f \text{at }a\\ &= \color{blue}{\lim_{x\to a^{+}}\left[\lim_{h\to 0}\frac{f(x+h) - f(x)}{h}\right]}\\ &= \lim_{x\to a^{+}}f'(x)\\ &= L \end{align*}
But the steps that I've outlined in red and blue correspond to geniune gaps in my argument. We cannot always interchange such limits without caution, but perhaps due to the strong assumptions on $f$ we can in this case.
Is there an example of a function $f$ (of course, satisfying the conditions give above) for which this logic fails?
If not, how can I fix my argument?