Zero knowledge proof with sum
Hint: what happens if the prover, instead of sending $g^r$ for a random $r$ that he knows in the first round, sends instead $g^{-x}\cdot g^r$ for a random $r$ that he knows?