If $f$ is an irreducible polynomial of degree $n$ over $\mathbb{F}_{p}$, then $\mathbb{F}_{p}[x]/(f)$ is the finite field $\mathbb{F}_{p^{n}}$ and the map $a \mapsto a^{p}$ is the Frobenius automorphism.
If $R$ is a commutative ring of characteristic $p$, then $a \mapsto a^{p}$ is still an endomorphism of $R$. Let $f$ be a polynomial with a root in $\mathbb{F}_{p}$. Is the Frobenius equal to the identity on $\mathbb{F}_{p}[x] / (f)$? What if $f$ splits over $\mathbb{F}_{p}$?
Let :
$$f=f_1^{n_1}...f_r^{n_r}$$
be the decomposition of $f$ in $\mathbb{F}_p[X]$ in irreducible polynomials. Then you get that by the chinese remainder theorem :
$$R:=\mathbb{F}_p[X]/(f)=\mathbb{F}_p[X]/(f_1^{n_1})\times...\times\mathbb{F}_p[X]/(f_r^{n_r}) $$
Now we see that to understand the Frobenius $\phi$ on this ring $R$ it suffices to understand it on each component. So what's happening on :
$$\mathbb{F}_p[X]/(f^{n})\text{ with } f \text{ irreducible?}$$
Suppose that $n\geq 2$ then take $g:=f$ mod $f^n\in \mathbb{F}_p[X]/(f^{n})$ Clearly this element verifies $g\neq 0$ but if you take :
$$n=qp+r $$
Then you see that $\phi^{q+1}(g)=f^{qp+p}=f^{qp+r}f^{p-r}=f^nf^{p-r}=0$.
In other term if $n\geq 2$ then the Frobenius cannot be an automorphism of the ring.
So to answer properly your question.
The Frobenius is an automorphism of $\mathbb{F}_p[X]/(f)$ if and only if $f$ is square-free.
In the case where $f=f_1...f_r$ is square-free the Frobenius is the identity if and only if it is the identity on each $\mathbb{F}_p[X]/(f_i)$ if and only if for each $i$, $\deg(f_i)=1$ if and only if $f$ splits on $\mathbb{F}_p$.