This is exercise four, chapter two, of the book "Algebra Lineal y Geometría" from Castellet and Llerena.
So far, I can see that $i$ is a root of $p$ and $-1$ one of $p-1$. Which means that $p(i) = 0$ and $p(-1) = 1$. After some computation, I can also see that $q(i) = -1/(1-i)$, where $p(x)+1 = (x^3+1) * q(x)$. I can see that the degree of $p$ is bigger than three. However, I wasn't able to infer much more. I tried guessing possible values with very little success. The question also doesn't specify the domain of $x$ and I fear I might have gone into a rabbit hole by playing with complex numbers.
Any help would be appreciated.
I think you want this:
$$ \left( x^{3} + 1 \right) \left( \frac{ - x - 1 }{ 2 } \right) - \left( x^{2} + 1 \right) \left( \frac{ - x^{2} - x + 1 }{ 2 } \right) = \left( -1 \right) $$
or
$$ \left( x^{3} + 1 \right) \left( \frac{ - x - 1 }{ 2 } \right) = \left( x^{2} + 1 \right) \left( \frac{ - x^{2} - x + 1 }{ 2 } \right) \; \; -1 $$
==============================
What follows is the Extended Euclidean Algorithm; where most people prefer "back-substitution," I write in the style of a continued fraction.
$$ \left( x^{3} + 1 \right) $$
$$ \left( x^{2} + 1 \right) $$
$$ \left( x^{3} + 1 \right) = \left( x^{2} + 1 \right) \cdot \color{magenta}{ \left( x \right) } + \left( - x + 1 \right) $$ $$ \left( x^{2} + 1 \right) = \left( - x + 1 \right) \cdot \color{magenta}{ \left( - x - 1 \right) } + \left( 2 \right) $$ $$ \left( - x + 1 \right) = \left( 2 \right) \cdot \color{magenta}{ \left( \frac{ - x + 1 }{ 2 } \right) } + \left( 0 \right) $$ $$ \frac{ 0}{1} $$ $$ \frac{ 1}{0} $$ $$ \color{magenta}{ \left( x \right) } \Longrightarrow \Longrightarrow \frac{ \left( x \right) }{ \left( 1 \right) } $$ $$ \color{magenta}{ \left( - x - 1 \right) } \Longrightarrow \Longrightarrow \frac{ \left( - x^{2} - x + 1 \right) }{ \left( - x - 1 \right) } $$ $$ \color{magenta}{ \left( \frac{ - x + 1 }{ 2 } \right) } \Longrightarrow \Longrightarrow \frac{ \left( \frac{ x^{3} + 1 }{ 2 } \right) }{ \left( \frac{ x^{2} + 1 }{ 2 } \right) } $$ $$ \left( x^{3} + 1 \right) \left( \frac{ - x - 1 }{ 2 } \right) - \left( x^{2} + 1 \right) \left( \frac{ - x^{2} - x + 1 }{ 2 } \right) = \left( -1 \right) $$