Ideal generated by irreducible polynomial and its Quotient Ring

Let F be a field and x be an indeterminate over F. Let f(x) \in F[x].Prove that F[x]/(f(x)) is a field if and only of f(x) is irreducible.

We know that for any ring R, R/I is a field if and only if I is a maximal ideal of R. To use it, we show that (f(x)) is maximal if and only if f(x) is irreducible.
"\Leftarrow" Let I = (f(x)) be maximal. We show 0\neq f(x) is irreducible. If possible, let f(x) = g(x)h(x) where the degree of g(x) and h(x) is at least one, for some g(x),\, h(x)\in F[x]. Here, g(x)|f(x) and h(x)|f(x) so the ideals J_1=(g(x)) and J_2=(h(x)) are proper and also contains I, which is a contradiction since I is maximal. So the polynomial is irreducible.
"\Rightarrow" Let f(x) be irreducible. We show I=f(x) is maximal. If possible, let I\subsetneq J for an ideal J of F[x]. Since F is a field so F[x] is a PID, so every ideal of f[x] is principal. Then for a polynomial g(x)\in F[x] is principal. Then for a polynomial g(x)\in F[x], J = (g(x)).
Since f(x)\in I \subsetneq J, so for f(x) \in J there is some q(x)\in F[x] s.t. f(x)=q(x)g(x). Since f(x) is irreducible, so either q(x) or g(x) is of degree zero. If deg\, f(x)=0 then g(x) is a unit in F[x]. Here, g(x)\in J i.e. J contains a unit, so J = F[x]. If deg\, q(x)=0 then f(x)=cg(x), for q(x)=c, constant. Then g(x)\in (f(x))=I i.e. J = (g(x))\subsetneq I i.e. J\subsetneq I. Hence, I = J. Which suggests that I=(f(x)) is maximal.
"\Leftarrow" Now, let F[x]/(f(x)) is a field, so the ideal (f(x)) is maximal. We have that if (f(x)) is maximal then f(x) is irreducible.
"\Rightarrow" Let f(x) is irreducible then (f(x)) is maximal so F[x]/(f(x)) is a field.