Derivative of step functions I was reading up on the Lebesgue integral and how it is computed. And since it is a generalization of the Riemann integral in a more theoretic framework, the same fundamental principle holds, only for absolutely continuous functions eg. $\int f'(x) d\mu = f(x)$. (I'm still new at this, so pardon the notation).
So, let's say we have $(\mathbb{R}, \sigma, \mu)$ with $\mu$ the Lebesgue measure on the reals. And so the integral of any step function is going to be $\int f d\mu = \sum a_k \mu(A_k)$ where are $a_k$ is the value $f$ takes on $A_k$. And since one of the properties of the Lebesgue integral is 
$\lim \int f_n d\mu = \int \lim f_n d\mu$ one can, through finer and finer approximations of an analytic function (similar to Riemann sums in the sense that a Riemann sum approximates the integral through finer and finer divisions of an interval, effectively assigning single values over subsets, therefore creating a family of step functions) can compute the Lebesgue integral, and if they both exist, the Lebesgue integral will be numerically equal to the Riemann-Darboux one.
However, for functions that are not absolutely continuous, the integral of the derivative will not equal the function. My question is how is the derivative computed? Intuitively, it seems that for a step function, the derivative only takes one of three values ${0, \infty, -\infty}$ (0 on a constant subset, and the other two at changing points). What is wrong in this reasoning?
Shorter version:  if $f$ (which is absolutely or not continuous) is a limit of sums of steps functions and Lebesgue integrable, how can it have a derivative that is non zero?
 A: For a concrete example, consider $f(x)=x$ on the interval $(0,1)$ (when dealing with derivatives of any kind, an open interval is preferable to a closed one). This function is absolutely continuous, with derivative $f'\equiv 1$. Yet, it is also the uniform limit of step functions $f_n(x)=n^{-1}\lfloor nx\rfloor $, which have zero derivative (except for finitely many points). Ho do we reconcile this? 
Option 1. Say "convergence of functions does not imply convergence of their derivatives", and leave it at that.  
Option 2. Take derivatives of $f_n$ in the sense of distributions. Such derivatives are no longer zero. Instead, $f_n'$ is a singular measure which consists of $n-1$ atoms of weight $1/n$ each. These measures converge weakly to the Lebesgue measure on $(0,1)$, which is the same as $1\,dx=f'(x)\,dx$. One says that $f_n'$ converge to $f_n$ as distributions. 
Caveat: not all distributions are measures. Some distributions are even more singular: for example, $f_n''$ is not a measure. Still, one has $f_n''\to f''\equiv 0$ in the sense of convergence of distributions.
A: Actually, there are functions, like the Weierstrass function (http://en.wikipedia.org/wiki/Weierstrass_function) which are nowhere differentiable. The latter is continuous, so measurable. You can consider its integral on some interval. You can approximate it with step functions. Each step function will be differentiable almost everywhere, BUT the limit function will not be differentiable.
