If $f'(x)$ has a limit as $x\to x_0$, then the function $f$ is differentiable at $x_0$ I've got a question about mathematical analysis of one-variable functions. Assume that we have a function defined for $x \neq x_0$ as composition/sum/product of differentiable functions and also $f(x_0) = a \in \mathbb{R}$. The task is to designate differentiability of $f$ in the domain (here: $\mathbb{R}$).
It is obvious for $x \neq x_0$. For $x_0$ we could check continuity in $x_0$ and compute one-sided derivatives of $f$ in $x_0$ by definition (if $f$ is continuous obviously). If left-side derivative equals right-side derivative, then $f$ is differentiable also in $x_0$.
Today I've heard about some "extension" of this method - how to determine differentiability without computing one-sided derivatives in $x_0$. Assume $f'$ is a derivative function computed for $x \neq x_0$. If $\lim_{x \to x_0^-} f'(x) = \lim_{x \to x_0^+} f'(x) = g \in \mathbb{R}$, then exists $f'(x_0)$ and also $f'(x_0) = g$. Could anyone sketch me a proof of this?
If we know that $f'(x)$ is continuous in $x_0$, we can obviously state that exists $f'(x_0)$ and it equals the limit of $f'$ in $x_0$, but the condition above is not a condition of continuity (we don't check whether $f'(x_0) = \lim_{x \to x_0} f'(x)$).  
 A: Assuming that $f$ has a limit at $x_0$ (otherwise this is false), you can use mean value theorem to get for $h > 0$, $(f(x + h) - f(x))/h = f'(y_h)$ for some $x < y_h < x + h$. Similarly for the left hand difference quotient.
A: The precise theorem you're asking about would be:

If $f$ is continuous, $f'$ is defined everywhere except possibly $x_0$ in some open interval containing $x_0$, and $\lim\limits_{x\rightarrow x_0}f'(x)$ exists, then $f'(x_0)$ exists and is equal to $\lim\limits_{x\rightarrow x_0}f'(x)$.

which is, in fact, true. (Notice that I compressed your statement about the limits on both sides existing and agreeing to simply the existence of the limit).
We have to be somewhat careful in proving this, since we can't, without proof, know that $f'(x_0)$ exists. Though - as an aside which I won't use in the proof, Darboux's theorem would guarantee that, if $f'(x_0)$ exists along with the limit thereto, then they are equal.
To start, let us define
$$g(x)=f(x+x_0)-f(x_0)+\left(\lim_{x\rightarrow x_0}f'(x)\right)(x-x_0)$$
which is a linear transformation of $f$ - which won't affect issues of differentiability except by scaling and shifting the derivative - which moves $(x_0,f(x_0))$ to the origin and ensures that the limit $\lim\limits_{x\rightarrow 0}g'(x)=0$. Proving that $g'(0)=0$ then suffices to establish the theorem for all $f$.
To do this, we put bounds on $g(x)$ near $0$ for positive $x$ (and we can proceed analogously for negative $x$). In particular, we have that, for any $\varepsilon>0$, there exists a $\delta$ such that for any $0<x<\delta$, it holds that $g'(x)<\varepsilon$. It is a simple exercise to show that this implies that for any $0<x,y<\delta$ in this interval $\frac{|g(x)-g(y)|}{|x-y|}<\varepsilon$, since the derivative is bounded everywhere in between. If we fix an $x$ and let $y$ go to zero, then invoke continuity, we get
$$\lim_{y\rightarrow 0}\frac{|g(x)-g(y)|}{|x-y|}=\frac{|g(x)-g(0)|}{x}$$
but since the function in the limit is bounded by $\varepsilon$, it is clear that $\frac{|g(x)-g(0)|}x<\varepsilon$ for all small enough $x$. It then simple to show that, by choosing $\varepsilon$ to be increasingly small, that $\lim_{x\rightarrow 0}\frac{|g(x)-g(0)|}x$ exists and equals $0$.
Notice that we need $f'$ to be defined everywhere near $x_0$ to exclude pathological cases like the Cantor function which is continuous and has a derivative of $0$ everywhere it has a derivative (and is differentiable at almost every point and hence has the limit of derivatives exist everywhere), but is not differentiable at $0$.
