Functions with discontinuous derivative at the endpoints of an open interval (a) Does there exist a function $f$ defined on the open interval $(a,b)$ such that $f'(b^-)$ exists, and $\lim_{x\to b-}f'(x)\neq f'(b^-)$, or (b) where $f'(b^-)$ exists and $\lim_{x\to b-}f'(x)$ does not exist?
Since $f(b)$ is undefined, define $$f'(b^-)=\lim_{h\to0+}\frac{f(b-h)-f(b-2h)}h.$$ Are there any difficulties with this definition as compared to the standard definition of the one-sided derivative?
Just reading my analysis textbook and thought this would make an interesting problem.
Related: $f(x)=x^2\sin\frac1x$ has a derivative which is defined at $0$ (equal to $0$), but $\lim_{x\to 0}f'(x)$ does not exist. (c) Is it always true that if the limit exists, it is equal to $f'(0)$? Even more curiously, $\limsup_{x\to0}f'(x)+\liminf_{x\to0}f'(x)=2f'(0)$ for this function. (d) Is this always the case, when the quantity on the left side of the equality is defined?
 A: Consider e.g.  a function of the form $f(x) = g(\log_2(b-x))$ where $g$ is periodic with period $1$.  This satisfies $f(b-2x) = f(b-x)$, and thus according to your definition $f'(b-) = 0$, while $f'(x) = - \dfrac{g'(\log_2(b-x))}{(b-x) \ln 2}$, so $\lim_{x \to b-} f'(x)$ will not exist unless $g$ is constant. 
EDIT: On the other hand, if $f$ is differentiable on $[b-2h,b-h]$ the Mean Value Theorem says
$ \dfrac{f(b-h) - f(b-2h)}{h} = f'(\xi)$ for some $\xi \in [b-2h,b-h]$, so if 
$\lim_{x \to b-} f'(x)$ exists then so does $f'(b-)$ and the two are equal.
Moreover, if $f'(b)$ exists, since $$\frac{f(b-h) - f(b-2h)}{h} = \frac{f(b-h) - f(b)}{h} - 2 \frac{f(b-2h) - f(b)}{2h}$$
we must have $f'(b-) = f'(b)$.
EDIT: As in your comments, suppose $g$ and $h$ are continuous and decreasing on $[0,\epsilon]$ with
$h(x) < g(x) < b$ for $x > 0$ and $g(0) = h(0) = b$, and you
define $f'(b-) = \lim_{x \to 0+} \dfrac{f(g(x)) - f(h(x))}{g(x) - h(x)}$.
Define a sequence $x_n$ by $x_0 = \epsilon$ and $h(x_{n+1}) = g(x_n)$.  Then
$x_{n+1} < x_n$ and $\lim_{n \to \infty} x_n = 0$.  Take any nonconstant continuous function
$f$ on $[h(x_0), g(x_0)] = [h(x_0), h(x_1)]$ with $f(h(x_0)) = f(h(x_1))$, and 
then define $f$ on $[h(x_n),h(x_{n+1})] = [g(x_{n-1},g(x_n)]$ iteratively by
$f(t) = f(h(g^{-1}(t)))$.  We obtain a continuous function $f$ on $[h(x_0), b)$
with $f(g(x)) = f(h(x))$, and thus $f'(b-) = 0$, but $\lim_{x \to b-} f(x)$, and
thus also $\lim_{x \to b-} f'(x)$, does not exist.
A: (a) If $\lim_{x\to b} f'(x)$ and $f'(b^{-})$ exist, then the limit equals $f'(b^-)$ because $\frac{f(b-h)-f(b-2h)}h=f'(b-\theta h) $ with some $\theta\in(1,2)$.

You've already given $f(x)=x^2\sin\frac1x$ as example for (b). Indeed, we also have $f'(0^-)=0$.

For (c) the same MVT argument applies as for (a).

(d) Let $g$ be smooth periodic and 
$$f(x)=\begin{cases}x^2\cdot g\left(-\frac1x\right)&\text{if }x>0\\
0&\text{if }x=0.\end{cases}$$
Then $f'(0)=0$ and $f'(x)=2x g(-1/x)+g'(1/x)$, hence $\limsup f'=\limsup g'$ and $\liminf f'=\liminf g'$.
If $g$ is asymmetric, we will have $\limsup f'+\liminf f'\ne0$.
Indeed, consider $g(t)=\sin t+\sin 2t$, a first approximation to a sawtooth curve, which has $g'(0)=3$ but $g'(t)>-3$ for all $t$.
