$$ f(x) =\begin{cases}\frac{x^2}{2}+4 & x \geq 0\\-\frac{x^2}{2}+2 & x < 0\end{cases} $$
Is $f(x)$ Riemann integrable in the interval $[-1, 2] ?$
Does there exist a function $g(x)$ such that $g'(x)=f(x)$ ?
Solution: I can see that the function is Riemann Integrable as there is only one point of discontinuity in the interval mentioned.
Also by First fundamental theorem of calculus there exists a function $g(t)$ such that
$\displaystyle g(t)=\int_{-1}^t f(x) \, dx$ where $t$ is in the interval $[-1, 2]$
But $f$ is not continuous at $x=0$. Thatwould mean $g'(c) \neq f(c)$ at all points in the interval.
What does it mean? Does there exist $g(x)$ as asked in the problem?
Suppose such a function $g$ exists. Try finding the one-sided derivatives of $g$ at $0$:
$$ \lim_{h\,\downarrow\,0} \frac{g(0+h)-g(0)}{h} = \lim_{h\,\downarrow\,0} \frac{\int_0^h f(x)\,dx}{h}= \lim_{h\,\downarrow\,0} \frac 1 h \left[ \frac{x^3}{6}+4x \right]_{x:=0}^{x:=h} = \lim_{h\,\downarrow\,0} \left(\frac{h^2}{6} + 4\right) = 4. $$
Then find the other one-sided derivative, involving $\displaystyle\lim_{h\,\uparrow\,0}$. If they're not equal, then there can be no function $g$ satisfying the requirements.