Knowing $f$ modulo $x^2+1$ and $x^3+1$ is equivalent to knowing $x$ modulo $\operatorname{lcm} (x^2+1,x^3+1)$, i.e. $(x^2+1) (x^3+1)$ unless $p=2$ in which case it is $(x+1)(x+1)^3$.
So the ordinary chinese remainder theorem implies that $f$ modulo $(x^2+1)^3+1$ is completely free except that $f$ modulo $$\operatorname{gcd} ( (x^2+1)(x^3+1), (x^2+1)^3+1) = \operatorname{gcd} ( (x^3+1), (x^2+1)^3+1)$$ (since $x^2+1$ is relatively prime to $(x^2+1)^3+1$ in every characteristic) is completely determined.
We have $(x^2+1)^3+1 = x^6 + 3x^4 + 3x^2 +2$ and dividing by $x^3+1$ gives remainder $ 3x^2 - 3x + 3$ so in characteristic $3$ this gcd is $(x^3+1)$ and in every other characteristic it is $x^2-x+1$.
So for $p$ not $3$, we see that $f$ is determined modulo $x^2-x+1$ and otherwise $f$ modulo $(x^2+1)^3+1$ is completely free.