$g(x) = x^{3}+2x^{2}+1$
$p(x) = x^{2}+x+2$
I don't know what I did wrong, hope you figured it out:
$g(x) = p(x)(x+1) + 4x + 6$
$p(x) = (4x+6)(2x+6)+1$
$1=p(x)-(2x+6)(4x+6)$
$1=p(x)-(2x+6)[g(x) - p(x)(x+1)]$
$1=p(x)+(5x+1)[g(x) + p(x)(6x+6)]$
$1=(5x+1)g(x) + 2(5x+1)(6x+6)p(x)]$
$1=(5x+1)g(x) + 2(2x^{2}+x+6)p(x)]$
$1=(5x+1)g(x) + (4x^{2}+2x+5)p(x)]$
So: my solution is $(4x^{2}+2x+5)$, but the text book report another result. Any suggestion?
Also: how can I say, without a doubt, that $F$ is a field?
$F$ can be seen as the algebra generated by the matrix $M = \begin{pmatrix} 0 & 0 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & -2 \\ \end{pmatrix}$( with entries in $GF(7)\; $), called the companion matrix of the polynomial $g(x) = x^3 + 2x^2 + 1$. This matrix describes the action of the multiplication with $x$ namely $1 \mapsto x$, $x \mapsto x^2$ and $x^2 \mapsto x^3=-1-2x^2$. Then the polynomial $p(x)=x^2+x+2$ is represented by the matrix $N = M^2+M+2M^0 = \begin{pmatrix} 2 & -1 & 1 \\ 1 & 2 & -1 \\ 1 & -1 & 4 \\ \end{pmatrix}$. The inverse of $p$ is then represented by the inverse $N^{-1} = \begin{pmatrix} 0 & -2 & 3 \\ 1 & 0 & 5 \\ 2 & 4 & -1 \\ \end{pmatrix} = 2M^2 + M $ (note that the coefficients of an element of the algebra in the basis $\{M^0, M, M^2\}$ always can be read from the first column) which corresponds to the polynomial $2x^2+x$.