If $f:\mathbb{R}\to \mathbb{R}$ and $f(x)=0$ if $x\in \mathbb{Z}$ and $f(x)=x-\lfloor x\rfloor-\frac12$ if $x\in \mathbb{R}-\mathbb{Z}$. Let $A(x)=\int_0^x f(t)\mathrm dt$.
Show that $A(x)=\dfrac{x^2-x}{2}$ if $0\leq x\leq 1$.
I am supposed to use the definition of Riemann Integral.