Let $K[X,Y]$ be the polynomial ring in two variables over the field $K$. Show that $\operatorname{dim}(K[X,Y]/(f))=1$ for any polynomial $f\in K[X,Y] $ that is not constant (in particular, non-zero).
First, since $\operatorname{dim}K[X,Y]\ge \operatorname{ht} (f)+\operatorname{dim}K[X,Y]/(f)$, we get $\operatorname{dim}(K[X,Y]/(f))\le 1$: in fact $f$ by assumption is neither invertible (i.e. constant) or a zero-divisor (i.e. zero), so we know that $\operatorname{ht}(f)=1$. So next we prove that $\operatorname{dim}(K[X,Y]/(f))\ge 1$.
I know that any maximal ideal of $K[X,Y]$ has height $\operatorname{dim}K[X,Y]=2$, so I can choose a maximal ideal $m\supseteq (f)$ and consider the localization $A:=K[X,Y]_m$, that hence has dimension $2$. The ideal $I:=(\frac f1)\subset A$ is proper because $(f)\subseteq m$, and $\frac f1$ is not a zero-divisor because $K[X,Y]$ is a domain. Thus $\operatorname{dim}A/I=1$. Now notice that $A/I$ explicitly is $$K[X,Y]_m/(f)K[X,Y]_m\cong (K[X,Y]/(f))_m,$$ so $$\operatorname{dim}(K[X,Y]/(f))\ge \operatorname{dim} (K[X,Y]/(f))_m = 1.$$
Does the proof look correct? I examined it well but I wouldn't be surprised if I missed to check something. Thank you.
Your proof is correct. If you read further you'll find $$\operatorname{ht}\mathfrak{p}+\operatorname{coht}\mathfrak{p}=\dim A$$ for $A$ a finitely generated $K$-algebra and an integral domain. Use Krull PI theorem and definition of height for general ideals you'll also get $\mathrm{coht}(f)=1$.