What is the largest class of measurable functions $f$ s.t. $f'$ a.e.? We know by Lebesgue Theorem that monotone functions on interval [a,b] has finite derivate almost everywhere and different of two monotone functions have finite derivative a.e. 
$\textbf{My Question}$ : what other functions have a.e. finite  derivative ? What is the largest class ?   
We know continuous functions are Riemann integrable and we can take derivative. and continuous functions with countably many discontinuous is Riemann integrable and again we can take derivative . Can I push more for example does any Riemann Integrable function has derivative a.e. ?  
Thanks in advance for your interest and help.
 A: The largest class of measurable functions $f$ such that $f'$ exists a.e. is $$\{f \,|\, f \text{ is measurable and $f'$ exists a.e. } \}$$
In practical terms, a useful sufficient condition is $f$ having bounded variation. (For function on an unbounded interval, it suffices to demand bounded variation in every finite subinterval.) I am not aware of a useful sufficient condition that is more general than BV.
Riemann integrability does not imply differentiability a.e. For example, let $f(x)=0$ if $x$ is irrational; and for rational $x$, let $f(x)=1/q$ where $q$ is the smallest positive integer such that $qx$ is an integer. This function is Riemann integrable on $[0,1]$, which can be verified directly, or by observing that $f$ is a uniform limit of piecewise continuous functions. (One such limit is  $f=\lim_{n\to \infty} \max(f,1/n)$.) However, $f$ is nowhere differentiable. Indeed, at rational points it's not even continuous. At an irrational point $x$ it attains a minimum, so the derivative would have to be $0$ if it existed. But for every $n$ we have a rational number  $x_n \in n^{-1}\mathbb Z$ such that $|x_n-x|\le 1/n$. Since $$\left|\frac{f(x_n)-f(x)}{x_n-x}\right| \ge \frac{1/n}{1/n} = 1$$
$f'(x)$ does not exist.
