Here are two different approaches to the problem in the OP. I leave most of the details to the asker.
- In the first approach, we extend any $f\in L_1(a,b]$ to a function in $f\in L_1(\mathbb{R})$ that vanishes outside $(a,b]$.
Definition: Consider $f\in L^p(\mathbb{R})$. A function $g\in L_p$ is the $L_p$ derivative of $f$ if $$\lim_{h\rightarrow0}\Big\|\frac1h(f(\cdot + h)-f(\cdot))-g(\cdot)\Big\|_p=0$$.
The following is a well known result in harmonic analysis (see Stein, E. and Weiss G., Introduction to Fourier Analysis on Euclidean spaces, Princeton Universe. Press, 1975, Chapter 1)
Theorem: If $f\in L_1(\mathbb{R})$ and $g$ is its $L_1$-derivative, then $$\widehat{g}(t)=2\pi i t \widehat{f}(t)$$
where $\widehat{\phi}(t)=\mathcal{F}\phi(t)=\int_{\mathbb{R}} e^{-2\pi itx}\phi(x)\,dx$ is the Fourier transform of a function $\phi\in L_1$
In particular, if $f$ has $L_1$-derivative equal to $0$, then $\widehat{f}=0$ and so $f=0$ (a.s.)
Proof: Notice that for $f\in L_1$, if $f_h(\cdot)=f(\cdot+h)$, then $\widehat{f_h}(t)=e^{2\pi its}\widehat{f}(t)$. Since $|\widehat{\phi}(t)|\leq\|\phi\|_1$ for any $\phi\in L_1$,
$$\Big|\frac{e^{2\pi iht}-1}{h}\widehat{f}(t)-\widehat{g}(t)\Big|\leq\Big\|\frac{1}{h}\big(f(\cdot+h)-f(\cdot)\big) -g(\cdot)\Big\|_1\qquad\Box$$
Example: Consider $f(x)=\mathbb{1}_{(0,1]}$. Then, for $h>0$
$$\frac{f(x+h)-f(x)}{h} =\frac{1}{h}\big(\mathbb{1}_{(-h,0]}(x)-\mathbb{1}_{(1-h,1]}(x)\big)\xrightarrow{h\rightarrow0}0\qquad\text{a.s}$$
Similar for $h\rightarrow0-$. However, $g=0$ is not the $L_1$-derivative of $f$, for
$$\Big\|\frac{1}{h}\big(f(\cdot+h)-f(\cdot)\big)\Big\|_1=2\qquad\Box$$
If in the OP we change $(a,b]$ for $\mathbb{R}$, or $f\in L_1(a,b]$ is extended extended as zero outside $(a,b]$ and the differential condition is set to
$$\lim_{h\rightarrow0}\frac1h\int_\mathbb{R}\Big|\big(\mathbb{1}_{(a,b]}f\big)(x+h)- \big(\mathbb{1}_{(a,b]}f\big)(x)\Big|\,dx=0,$$
then the Theorem above implies that $f=0$ (almost surely).
- Another view of the problem is to extends functions in $L_1(a,b]$ periodically (with period $T=b-a$. Without loss of generality, assume $T=1$ and $(a,b]=(0,1]$. Equivalently, we my consider $f$ as a function on the circle $\mathbb{S}^1$. Let $\lambda(dx)$ be the normalized Lebesgue (normalized arc length) measure on $(\mathbb{S}^1,\mathscr{B}(\mathbb{S}^1))$. As before
Definition: For $f\in L_p(\mathbb{S}^1)$, a function $g\in L_p(\mathbb{S}^1)$ if
$$\lim_{h\rightarrow0}\Big\|\frac{f(\cdot+h)-f(\cdot)}{h} -g(\cdot)\Big\|_p=0$$
A similar result to the Theorem above holds. For any $\phi\in L_1(\mathbb{S}^1)$ let $\hat{\phi}(n)=\int^1_0 e^{-2\pi inx}\phi(x)\,dx$ be its $n$-th Fourier coefficient, $n\in\mathbb{Z}$. If $f\in L_1(\mathbb{S}^1)$ admits an $L_1$-derivative $g$, then
$$
\Big|\frac{e^{2\pi ihn}-1}{h}\hat{f}(n)-\widehat{g}(n)\Big|\leq\int_{\mathbb{S}^1}\Big|\frac{f(x+h)-f(x)}{h}-g(x)\Big|\,dx$$
Hence, for $n\in \mathbb{Z}$,
$$2\pi in\widehat{f}(n)=\widehat{g}(n)$$
Consequently, if $g=0$, then $\widehat{f}(n)=0$ for all $n\in\mathbb{Z}\setminus\{0\}$. Therefore, $f=\widehat{f}(0)$ a.s.