Assume that $f:[a,b]\to\mathbb R$ has a finite derivative for every $x$, and that $f^{'}$ is Lebesgue integrable over $[a,b].$ Prove that $$f(x) - f(a) = \int_{a}^{x} f'(t)\,dt, \,\,\,\text{for all}\,\, x \in [a,b].$$
Hint given to me:
Define the function $g_{n}(x)$ (called cutting from above function)as follows:
$$g_{n}(x) = \begin{cases} f'(x), & \textbf{if} \quad f'(x) \leq n, \\ n, & \textbf{if} \quad f'(x) > n. \end{cases}$$
And define $h_{n}(x)$ (called cutting from below function)as follows:
$$h_{n}(x) = \begin{cases} f'(x), & \textbf{if} \quad f'(x) \leq n, \\ -n, & \textbf{if} \quad f'(x) > n. \end{cases}$$
But still, I did not get what next should I do to write a rigorous solution could anyone help me in this, please?
Set $g_n(x)=n\big( f(x+\tfrac{1}{n})-f(x)\big)$. Then, for every $t\in [a,x]$ and $n\in\mathbb N$, there exists an $\xi_n$, such that $$ |g_n(x)|=|f'(\xi_n)|\le \sup |f'(x)|=M<\infty. $$
Then $g_n(x)\to f'(x)$ pointwise and $|g_n(x)|\le M$. Hence by virtue of the Lebesgue Dominated Convergence Theorem $$ \lim_{n\to\infty}\int_a^x g_n(x)\,dx=\int_a^x f'(x)\,dx. $$ But $$ \int_a^x g_n(x)\,dx=n\int_b^{b+1/n} f(t)\,dt-n\int_a^{a+1/n} f(t)\,dt\to f(x)-f(a). $$