I want to show that if $K$ is a field then $K[x]$ is principal
Here is what I did:
I took 2 polynomial p(x) and q(x). Since we're on a field we can do a euclidean division of polynomials:
$q(x) = p(x)a(x) + r(x)$ with $deg(r) < deg(p)$
Now if $r= 0$ we obviously have $p \in (q)$
But I don't know how to show that it is principal if $r \neq 0$
Also I would like to show that the assertion is false if we replace "$K$ is a field" by "$K$ is a principal domain and an integral domain". I can't figure out how to do that
Hint: Let $0 \neq I \subsetneq K[x]$ be an ideal. Let $0\neq f\in I$ such that
$$ deg(f)= \min\{ deg(g) \ : \ g\in I \}.$$
Use your argument above to show $I=(f)$.
For your second question I'd suggest that you show that the ideal $(2, x)\subseteq \mathbb{Z}[x]$ is not principal.