Prove that g(0)=0? (taken from Spivak's calculus page 281)

Suppose that $f$ and $g$ are differentiable functions satisfying
  $$ \int_{0}^{f(x)} (fg)(t) \, \mathrm{d}t=g(f(x))$$
  Prove that $g(0)=0$.

Now if $f(x)=0$ in some point then it's straightforward that $g(f(x))=g(0)=0$. 
Anyways:
differentiating the first formula we get the following equation : 
$$f'(x).(fg)(f(x))=g'(f(x)).f'(x).$$
Let's suppose that $f'(x)=0$, thus $f$ is constant i.e $f(x)=c$, if $c=0$ we are done, $g(0)=0$ , if $c\neq 0$ then :
$\displaystyle \int_{0}^{c} fg(t) \, \mathrm{d}t$=g(c)
$\displaystyle \int_{0}^{c} g(t) \, \mathrm{d}t$=g(c)/c, i'm stuck here , how can we prove that g(0)=0 (or get a contradiction) from this equation?
EDIT : i had a lot of typos fixed them , sorry first time posting..
EDIT 2 : i checked spivak's calculus solutions book and i didn't find this question he just jumos from question 7 to 9 (ignoring this one ) 
 A: I'll show that $g(0) = 0$ does not have to hold.
We have
$$
\displaystyle c \int_{0}^{c} g(t) \, \mathrm{d}t = g(c)
$$
Now take $g(x) = e^x$ and we will find such a $c$ that above identity holds.
$$
c\int_0^c e^t dt = g(c)
$$
$$
c ( e^c - 1  ) = e^c
$$
$$
0 = (1-c)e^c + c
$$
And as you can see from its graph it has nonzero solution. So for $f(x) = c \approx 1.34998$  and $g(x) = e^x$ the property 
$$
\displaystyle \int_{0}^{f(x)} f(t)g(t) \, \mathrm{d}t = g(f(x))
$$
holds and $g(0)\neq 0 $. It would be interesting to investigate a little variation to you quastion.

Decide if there is nontrivial $g$ that for every $f$
  $$
\displaystyle \int_{0}^{f(x)} f(t)g(t) \, \mathrm{d}t = g(f(x))
$$
  holds. And decide if this nontrivial $g$ has to also satisfy $g(0)=0$

A: We have to understand that by the conditions given it follows that 
$$f'(x)f(f(x))g(f(x)) = g'(f(x))f'(x)$$ and cancelling $f'(x)$ we can see that $$f(y)g(y) = g'(y)$$ and therefore $g$ is anti-derivative of $fg$. It now follows clearly that the integral in question must be $g(f(x)) - g(0)$ and since it is given as $g(f(x))$ it follows that $g(0) = 0$.
