<s>[INST] Finding a polynomial by divisibility 
Let $f(x)$ be a polynomial with integer coefficients. If $f(x)$ is divisible by $x^2+1$ and $f(x)+1$ by $x^3+x^2+1$, what is $f(x)$?

My guess is that the only answer is $f(x)=-x^4-x^3-x-1$, but how can I prove it?
 [/INST] This is a straightforward application of CRT = Chinese Remainder Theorem.
By hypothesis $\ (x^2\!+1)g = f = -1 + (x^3\!+x^2\!+1)h\ $ for some polynomials $\,g,h,\,$ so
${\rm mod}\ x^2\!+\!1\!:\ x^2\equiv -1\,\Rightarrow\,1\equiv (x^3\!+x^2\!+1)h\equiv -xh\,\Rightarrow\, h \equiv -1/x\equiv x^2/x\equiv \color{#c00}x$
Therefore $\ h = \color{#c00}x + (x^2\!+1)h',\ $ for some polynomial $\,h'$
$\!  \begin{align}{\rm hence}\ \  f\, =&\, -1 + (x^3\!+x^2\!+1)(\color{#c00}x+(x^2\!+1)h')\\  =&\ \ x^4\!+x^3\!+x-1 + (x^3\!+x^2\!+1)(x^2\!+1) h'\end{align}$
</s>