Suppose $ y = g(x_1) - g(x_2)$ on $[a,b],$ and there exists a smooth function $h$ over $[a,b] $ such that $h(y) = \frac{x_2}{x_1}.$
Then, does there exist a set of non-trivial functions $A$ algebraic in $y,f(y)$ such that $g(x_1) +A(y,h(y)) = -g(x_2) + A(y,h(y))$?
For instance I could take someting like $y-\frac{g(x_2)+g(x_1)}{g(x_1)}$ or $(g(x_1)-g(x_2))^2 - \frac{g(x_2)^2}{g(x_1)^2}$ or etc, but it doesn't seem any such combination yields the desired result, and because of that, I don't know if it is impossible. Assessing the possibility could require more abstract properties.