Dividing polynomial $f(x^3)$ by $x^2+x+1$ Given two polynomials with real coefficients $g(x)$ and $h(x)$.
Additionally,  $x^2+x+1$ is a factor of $f(x^3)= h(x^3)+xg(x^3)$.
Prove that $x-1|h(x)$ and $x-1|g(x)$
I have tried to solve it by doing this;
$(x-1)(x^2+x+1)|(x-1)(h(x^3)+xg(x^3))$
then;
$(x^3-1)|(x)(h(x^3)-g(x^3)) + (x^2)g(x^3) - h(x^3)$
consider degree of $3k, 3k+1, 3k+2$ separately, I got;
$(x^3-1)|(x^2)g(x^3)$ and $h(x^3)$
Lastly, $(x^3-1)|g(x^3), h(x^3)$ and so on finish proving.
I wonder, is it correct to separate three cases of degrees in this problem?

$\!\bmod x^2\!+\!x\!+\!1\!:\,\ \color{#c00}{x^3\equiv 1}\,$ so $\, 0\equiv h(\color{#c00}{x^3})\!+\!xg(\color{#c00}{x^3})\equiv h(\color{#c00}1)+xg(\color{#c00}1)\iff h(1)=0=g(1)$
