$K \leq L, a \in L$
I am looking at the proof that if $a$ is algebraic over $K$, then $K(a)=K[a]$ :
We show that $K[a]$ is a field, then we have that $K \subseteq K[a] \subseteq K(a) \subseteq L$.
Let $0 \neq c \in K[a]$, then $c=f(a), f \in K[x]$.
Let $p(x)=Irr(a,K)$.
Since $p(a)=0$ and $f(a) \neq 0$, we have that $p(x) \nmid f(x)$, so we have that $(p(x), f(x))=1$.
Therefore, there are $h(x), g(x) \in K[x]$ with $h(x) \cdot p(x)+g(x) \cdot f(x)=1$.
For $x=a$: $h(a) \cdot p(a)+g(a) \cdot f(a)=1 \Rightarrow h(a) \cdot 0+g(a) \cdot f(a)=1 \Rightarrow g(a) \cdot f(a)=1$.
$$$$
We have the following: $K \leq L, a \in L$
$$K[a]=\{f(a), \text{ with } f(x) \in K[x]\}$$ $$K(a)=\{f(a) \cdot g^{-1}(a), \ \ f(x), g(x) \in K[x], g(a) \neq 0 \}$$
Why does it stand that $$K \subseteq K[a] \subseteq K(a) \subseteq L$$ ??
Could you explain me the proof above?? How did we show that $K(a)=K[a]$??
Does the reverse also stand?? Does it stand that if $K(a)=K[a]$, then $a$ is algebraic over $K$??
For your second question, the answer is yes. $K(a) = K[a]$ iff $a$ is algebraic. If $a$ is not algebraic, then it is transcendental, so $K[a]\cong K[X]$, which is not a field. To see this last result, use the evaluation homomorphism at $a$, $f:K[X]\to L$. We have that $K[a]=f(K[X])$ and if $a$ is transcendental, then there is no polynomial $g\in K[X]$ such that $g(a)=0$, so $\ker f= 0$ and $f$ is an isomophism.