So f'(x) is basically a slope. Since we want f(8) to be as small as possible, we would want smallest slope from x=3 to x=8, right?
f'(x) can only be 2 and not less so then f(x) would increase by 2 for every x increasing by 1 all the way to x=8.
So then smallest possible f(8) would be f(8) = f(3) + 2 + 2 + 2 + 2 + 2 = f(3) + 2(8-3) = 21
Hope this helps.