Continuity at x=q means that f(q) is defined and lim f(x) = f(q) as x→q. This means that if the function changes at a given point (here, 0 and 4), the limit as x approaches the point of change must be the same whether x is approaching from the left or right.
Thus, as x→0 (from the left), F(x) →(-B)/(-2) = B/2
Also, as x→0 (from the right), Ax + B → B, therefore, B = B/2. B = 0 is the only value such that the limits of x as it approaches zero from the left and right are the same – the condition of continuity there.
As x → 4 (from the left), Ax + B → 4A + B = 4A
As x → 4 (from the right), 2x2 → 32, therefore, A = 8
The answer is A = 8 and B = 0.