I know from definition that: $K(\alpha)$ denotes the smallest subfield of $L$ that contains both $K$ and $\alpha$.
I've read here that this is equivalent with:
$$K(\alpha) = \left\lbrace \frac{f(\alpha)}{g(\alpha)} : f,g\in K[X],\, g(\alpha)\neq 0\right\rbrace.$$
But I don't see how this makes sense.
Let $K(\alpha)$ be the smallest subfield containing $\alpha$ and let $$K'(\alpha) = \left\lbrace \frac{f(\alpha)}{g(\alpha)} : f,g\in K[X],\, g(\alpha)\neq 0\right\rbrace.$$ You want $K'(\alpha) = K(\alpha)$.
First convince yourself that $K'(\alpha)$ is a subfield containing $\alpha$. Then by definition you have $K(\alpha) \subseteq K'(\alpha)$.
To get $K'(\alpha) \subseteq K(\alpha)$ take an element $f(\alpha)/g(\alpha) \in K'(\alpha)$. Note that the coefficients of $f(x)$ are contained in $K(\alpha)$ and $\alpha$ is also contained in $K(\alpha)$ so $f(\alpha) \in K(\alpha)$. Similarly $g(\alpha) \in K(\alpha)$. As $K(\alpha)$ is a field we then get $f(\alpha)/g(\alpha) \in K(\alpha)$.