Well the fact it is continuous on an interval and does not vanish on this interval implies that it is of fixed sign.(Btw, for this theorem, which is known as the mean value theorem for integrals, g actually needs to be a function of fixed sign, rather than just non-zero.)