Suppose $g$ is a continuous function on $[a,b]$ and that $g(t)\ge0$ for all $t\in[a,b]$. Show that if $\int_{a}^{b}g(t)dt=0$ then $g(t)=0$ for all $t\in[a,b]$
I know that there exists some function $G(x)= \int_{a}^{b}g(t)dt$ where $G(x)$ is differentialable at any $c$ in the interval where $G'(c)=g(c)$. Now since $g(t)$ is always positive it should follow that $G'(x)$ is always positive therefore $G(x)$ would be increasing.
Now given $G(x)= \int_{a}^{b}g(t)dt =0$ would mean that $G(b)-G(a)=0$ thus $G(b)=G(a)$ now since $G(x)$ is increasing that would mean that $g(t)=0$ for all $t$ in the interval.
Your answer is very close to the right one.
Let $G$ be a primitive of $g$ on $[a,b]$, Since $g\geqslant 0$, $G$ is increasing and $a<b$ implies that $G(a)\leqslant G(b)$. Thus, $\int_a^b g(x) dx \geqslant 0$.
If $\int_a^b g(x) dx = 0$ then $G(a)=G(b)$ and since $G$ is increasing, it is constant over $[a,b]$ therefore its derivative $g$ is zero.
The reciprocal is fairly obvious.
Notice how you wrote $G(x) =\int_a^b g(t) dt$ but that expression does not depend on $x$.