Edit: What I really wanted to ask was why we could do the identification below (but I asked a wrong question and it was my bad). Thanks for the comments and answers.
Suppose we have a field $K$.
We can take an irreducible polynomial $f$ with a positive degree in $K[x]$.
Since $K[x]$ is a PID, we know $(f)$ is maximal and $K[x]/(f)$ is a field. We can also view $K[x]/(f)$ as $K[\bar{x}]$, where $\bar{x}=x+(f)$. Since $K[\bar{x}]$ is a field, we may write it as $K(\bar{x})$, the field generated by $\bar{x}$ over $K$.
Now we can define a field homomorphism from $K$ to $K[x]/(f)$ by sending $k\mapsto \bar{k}$.
My book then says, by identifying $K$ with its image in $K[x]/(f)$, we can regard $K[x]/(f)$ as a field extension of $K$. Up to here, it is still ok to me because I know some people like abusing notations. Then comes a theorem whose statement makes me uncomfortable and hard to follow (in a rigorous way).
The Theorem. Let $K$ be a field and $f\in K[x]$ a polynomial of degree $n\geq 1$. Then there exists a simple extension field $F$ of $K$ such that: $F=K(u)$, and $u\in F$ is a root of $f$.
The way my book constructs $F$ is just letting $F:=K[x]/(f_1)$, where $f_1$ is an irreducible factor of $f$. The rest is just showing why $F$ is a field, which is not our focus here. And the book then just says that $F$ is a field extension of $K$, where the book has used the "identification" I mentioned above.
My question is, why can we call $F$ a field extension of $K$?
We have precise definition of field extension, by which, $K$ needs to be a subset of $F$ so that we can say $F$ is a field extension of $K$. Here $K$ is clearly not in $F$ because $F$ is a collection of equivalent classes (or cosets). Really confused. Thanks for help.
By the same way we identified $K$ with a subfield of $K[x]/(f)$ in the example above we can identify it with a subfield of $F$ in the proof, as this identification is canonical we can just view $K$ as a subfield of $F$ by this identification.
For example take $f(x) = x^2-2 \in \mathbb Q[x]$ then $\mathbb Q(\sqrt2)\cong\mathbb Q[x]/(f)=F$ and we can identify $\mathbb Q$ with a subset of $F$.