We have that $g$ is a measurable and bounded function on $[a,b]$. I have $\int_a^cg=0$ for every $c\in[a,b]$. I want to show $g=0$ on $[a,b]$ except possibly on a subset of measure zero.
Proof.
By way of contradiction, suppose $A=\lbrace x\in [a,b]|g(x)\not=0 \rbrace$ has positve measure. Then $0=\int_a^{\sup A}g=\int_a^{\inf A}g+\int_{\inf A}^{\sup A}g=\int_{\inf A}^{\sup A}g$, but I think the last integral can be 0, so there's no contradiction.
Since $A$ has positive measure and $g\not=0$ on $A$, I would like to argue that there is a number $d$ for which $\int_{\inf A}^dg$ is strictly positive or negative, but I don't even know if that is true.
Can you use the Lebesgue density theorem?
EDIT: I don't know how your instructor presented Lebesgue measure and integration: there are several ways to do it, and this may affect which way of attacking the problem is more natural. One approach is this. Suppose the statement is false. There is some $\epsilon > 0$ such that $\{x: g(x) > \epsilon\}$ or $\{x: g(x) < -\epsilon\}$ has strictly positive measure. For definiteness let's suppose it's $A = \{x: g(x) > \epsilon\}$ (otherwise multiply $g$ by $-1$). Approximate $A$ well enough by a finite union $B$ of disjoint intervals $[a_i, b_i]$ that you get a contradiction from the fact that each $\int_A g \ge \epsilon\; m(A)$ while $\int_B g = 0$.