Question 1.22 Unit 5 Hungerford Algebra I am self studying Field theory and was trying some problems from Thomas Hungerford. I am struck on this problem  on page 242 and need help.

F is an algebraic extension of K if and only if for every intermediate field E every monomorphism $\sigma : E \to E $ which is the identity on K is in fact an automorphism of E.

I tried both sides of proof but couldn't do any.
Why if F is an algebraic extension then every $\sigma$ must be onto?
And conversaly, how if such $\sigma$ is an automorphism then why $\sigma $ is algebraic.
I have studied textbook thoroughly but there have been many questions which I asked.so, I would like to work on this problem by myself. Just give hints on which result  should I use as ultimately exercises are for my understanding not any others.
Thanks!!
 A: Let's first assume $F/K$ is algebraic and let $\sigma: E \longrightarrow E$ fixes $K$ (with $F/E/K$). Now let's take some $a \in E$. We want to show that this is in the image of $\sigma$. As $a \in E \subseteq F$, $a$ is algebraic over $K$. Thus, there is some $f \in K[x]$ nonzero such that $f(a) = 0$. Let $S \subseteq E$ be the set of all roots of $f$ in $E$. Note that as $\sigma$ fixes $K$, we have that $\sigma(f(b)) = f(\sigma(b))$ for all $b \in E$. Hence, $\sigma[S] \subseteq S$. We can therefore conclude that the restriction of $\sigma$ maps $K(S)$ to $K(S)$. Furthermore, there are only finitely many elements in $S$. As each is algebraic over $K$, we have that $K(S) / K$ is a finite extension. Thus, $\sigma: K(S) \longrightarrow K(S)$ is an injective map of finite dimensional $K$-vector spaces and is therefore an isomorphism on $K(S)$. As $a \in S$, we conclude that $a \in im(\sigma)$. Since $a$ was arbitrary, $\sigma$ is onto.
Now let's do the converse. As suggested in the comments, we'll approach this by contraposition. Suppose $F/K$ is not algebraic. Then there is some element $a \in F$ that is not algebraic over $K$. Consider then the map $\sigma: K(a) \longrightarrow K(a)$ via $a \mapsto a^2$. We claim that this is not an isomorphism. In particular, we show that $a$ is not in the image of $\sigma$. If it was, then there would be some $b \in K(a)$ such that $\sigma(b) = a$. We write $b = \sum_{i = 0}^{n} b_i a^i$ with $b_i \in K$. Let us also insist that $b_n \neq 0$. Indeed, clearly $b = 0$ cannot work here so this assumption is valid. Then $\sigma(b) = \sum b_i a^{2i} = a$. However, this is a polynomial relation for $a$! We can rewrite this as $\sum b_i a^{2i} - a = 0$. As we assumed $b_n \neq 0$, this is not the zero polynomial. However, we assumed that $a$ was not algebraic over $K$, so $a \notin im(\sigma)$.
