Think geometrically! The condition tells you that the function g is convex. The maximum value of g(1) will occur when g''(x) is equal to 4 throughout the interval. If g''(x) is ever greater than 4 (with the endpoints at (-2,5) and (2,1) remaining fixed) then the curve will become more convex, forcing g(1) to be smaller.

So let g''(x) = 4. Integrate twice to get . You can find the values of the constants a and b by using the facts that g(-2)=5 and g(2)=1, and then you will know what g(1) is.