If $f$ is irreducible and $g \neq 0$, then either $\gcd(f, g) = 1$ or $f \mid g$ Suppose we have a field $K$, $f \in K[x]$ is an irreducible polynomial and $0 \neq g \in K[x]$, how can I prove that either $\gcd(f, g) = 1$ or $f$ divides $g$.
I've tried both ways, assuming that $f$ doesn't divide $g$ and trying to prove that $\gcd(f, g) = 1$ and that $\gcd(f, g) \neq 1$ and $f \mid g$, but haven't made any progress.
 A: Because $\gcd(f,g)$ divides $f$ there exists $h\in K[x]$ such that $f=h\cdot\gcd(f,g)$. Because $f$ is irreducible this implies that either $h$ or $\gcd(f,g)$ is a unit. Then either $\gcd(f,g)=1$ or $\gcd(f,g)=uf$ for some unit $u\in K[x]$. Because $\gcd(f,g)$ divides $g$ this shows that either $\gcd(f,g)=1$ or $f$ divides $g$.
A: Question: "Suppose we have a field $K$, $f \in K[x]$ is an irreducible polynomial and $0 \neq g \in K[x]$, how can I prove that either $\gcd(f, g) = 1$ or $f$ divides $g$. I've tried both ways, assuming that $f$ doesn't divide $g$ and trying to prove that $\gcd(f, g) = 1$ and that $\gcd(f, g) \neq 1$ and $f \mid g$, but haven't made any progress."
Answer: Hint: $k[x]/(f(x))$ is a field. Assume $f(x)\in k[x]$ is (non-constant) irreducible and assume $g(x)\neq 0$ and let $k(\alpha):=k[x]/(f(x))$ where by definition $\alpha:=\overline{x}$.
Assume $g\notin (f(x))$. It follows $g(\alpha)\neq 0$ and since $k(\alpha)$ is a field, there is an element $h(\alpha)$ with $h(\alpha)g(\alpha)=1$ in $k(\alpha)$. It follows there is a polynomial $p(x)\in k[x]$ with
$$h(x)g(x)=1+p(x)f(x)$$
hence
$$h(x)g(x)-p(x)f(x)=1$$
and it follows there is an equality of ideals $(g(x),f(x))=1$. Conversely if $(g,f)=1$ it follows there are polynomials $h,p$ with $hg+pf=1$. If $g\in (f(x))$ you would get $g=g'f$ and
$$ hg'f+pf=(hg'+p)f=1$$
a contradiction since $f(x)$ is non-constant. Hence $(g,f)=1$ iff $g\notin (f(x))$. Hence two situations can occur $g \in (f(x))$ or $g\notin (f(x))$ or equivalently  $g\in (f(x))$ or $(g,f)=1$.
