What's the idea behind this problem

Let f and g be continuous functions defined on [0,1]. If f(1/2) = 1, f(3/4) = −6 and g(1/2) = −2, g(3/4) = 3, prove that there exists a c in [0,1] such that (f^2)(c) + 2007f(c) = (g^2)(c) + 2007g(c) ?

Thanks for any help.