Show that $x^2$ is irreducible but not prime in the ring of polynomials with no linear term. Show that $x^2$ is irreducible but not prime in the ring of polynomials with rational coefficients and no linear term:
$$R = \{a_0 + a_2 x^2 + ... a_nx^n \in \mathbb Q[x]\}$$
I am actually very confused, I proved that $x^2$ is in fact a prime. Let $x^2|f(x)g(x)$ then $x^2m(x)=f(x)g(x)$ and so $f(0)g(0)=0$. Now assume that$x^2\not |f(x)$ and $x^2\not|g(x)$ then we know that $f(0)\not=0$ otherwise $f(x)=x^2(a_nx^{n-2}+...+a_2)$ same with $g(0)$ hence $g(0)f(0)\not=0$ thus $x^2$ is prime. Where is my error?

Your error is that the factor $a_nx^{n-2}+\dots+a_2$ may have a linear term and thus may not be in $R$.  For instance, if $f(x)=g(x)=x^3$ then $x^2$ divides $f(x)g(x)=x^6=x^2\cdot x^4$ but $x^2$ does not divide $f(x)$ or $g(x)$ since they would factor as $x^2\cdot x$ but $x\not\in R$.
