if $f(x)=\int_0^x \lfloor{t}\rfloor \,dt$ for $x≥0$, draw the graph of $f$ over the interval [0,4]

if $f(x)=\int_0^x \lfloor{t}\rfloor \,dt$ for $x≥0$, draw the graph of $f$ over the interval [0,4]

This is an exercise from Apostol's Calculus Vol.1.

I quite don't get how to write $\int_0^x \lfloor{t}\rfloor \,dt$ as an algebraic expression without knowing calculus' fundamental theorem and $\lfloor{t}\rfloor$'s derivative, which haven't been introduced yet.

I input the function in a function plotter, and came up with this. But I need to know why the graph is like this, to do the problem for my self, and understand it.

Could you help me?

If $x \in [0,1)$, $f(x) = \int_0^x \lfloor t \rfloor \, dt= \int_0^x 0\, dt=0$.
If $x \in [1,2)$, $f(x) = \int_0^1 \lfloor t\rfloor \, dt + \int_1^x \lfloor t \rfloor \, dt= \int_0^1 0\, dt + \int_1^x 1\, dt=x-1$.
If $x \in [2, 3)$, $f(x) = \int_0^1 \lfloor t\rfloor \, dt + \int_1^2 \lfloor t\rfloor \, dt + \int_2^x \lfloor t \rfloor \, dt= \int_0^1 0\, dt + \int_1^2 1\, dt + \int_2^x 2\, dt=1+2(x-2)$.
In general, if $x \in [n, n+1), n \in \mathbb{N} \cup \{0\}$,