We know that $f(x) = |x|$ is not differentiable at $x = 0$ (the derivative approaches $1$ as $x \to 0^+$ while the derivative approaches $-1$ as $x \to 0^-$). However, if I were to define a function $g$ such that
$$g(x) = \begin{cases} 1 &\text{if } x \geq 0 \newline -1 &\text{if } x < 0 \end{cases}$$
Then if I define $f(x) = \int_0^x g(x)$, $f(x) = |x|$ and $f'(x) = g(x)$ by the fundamental theorem of calculus. However, in this case, $f'(0) = g(0) = 1$ but we just established in the first paragraph that $|x|$ is not differentiable at $x = 0$.
What am I missing here?
Edit: I cannot use the fundamental theorem of calculus because $g$ is not continuous.
It turns out I cannot define an everywhere differentiable function such that its derivative is equal to $g$ by Darboux's theorem