The difference between g(x) and f(x) must be between 1 and 3, for all x in the interval. What's more, g is continuous, so it can't be greater than f(x) for some values of x, and less than f(x) for other values of x. So either $x^2+3\leqslant g(x)\leqslant 5$ for all x in [0,1], or $x^2-1\leqslant g(x)\leqslant 1$ for all x in [0,1].