we can see from the given graph that:

f '(x) = -x_____0 <= x <= 1

______-1 _____1 <= x <= 3

______x-4_____3 <= x <= 5

_______1______5 <= x <= 6

let's integrate f '(x) in the first interval:

f(x) = integ(-x dx) = -x^2 / 2 + C for all 0 <= x <= 1

now we know that f(0) = 5, thus C = 5

---> f(x) = 5 - 0.5*x^2 0<= x <= 1

which means that f(1) = 4.5

now we proceed to integrate f '(x) in the following interval using the initial condition you've got from the previous interval namely f(1) = 4.5, we continue this way till the last interval...