You can put this solution on YOUR website! By the extreme value theorem, f has a maximum. If the x-value corresponding to the maximum occurred in the interval (0,2), then the sign of f'(x) would have to change (e.g. if the function is differentiable, then f'(x) = 0 for some x strictly between 0 and 2). This cannot happen, so the maximum of f is either at x = 0 or x = 2.