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?