Why does $K \leadsto K(X)$ preserve the degree of field extensions? The following is a problem in an algebra textbook, probably a well-known fact, but I just don't know how to Google it. 

Let $K/k$ be a finite field extension. Then $K(X)/k(X)$ is also finite with the same degree as $K/k$. 

Obviously if $v_1,...,v_n$ is a $k$-Basis of $K$, any polynomial in $K(X)$ can be written as a $k(X)$-linear combination of $v_1,...,v_n$, but I have no idea what to do with a nontrivial denominator.
Is there perhaps a more elegant way of proving this?  
 A: Let $K/k$ be a field extension. Then $K \otimes_k k(X)$ is a localization of the integral domain $K \otimes_k k[X] = K[X]$, thus the natural map $K \otimes_k k(X) \to K(X)$ is injective. Now we have the following equivalence:
a) $K/k$ is algebraic
b) Every polynomial over $K$ divides some polynomial over $k$.
c) $K \otimes_k k(X) = K(X)$.
$a \Rightarrow b$: Because of uniqueness of the division algorithm, it suffices to prove divisibilty in an algebraic extension. So take a splitting field of the polynomial and reduce to the case of linear factors $x-a$. But they divide the minimal polynomial over $k$.
$b \Rightarrow c$: $K \otimes_k k(X)$ is the localization of $K[X]$ at all nontrivial polynomials over $k$. Since we have $b$, we localize at all nontrivial polynomials  over $K$, i.e. we get $K(X)$.
$c \Rightarrow a$: Take $u \in K$. Then $1/(X-u) = p/q$ for $p \in K[X], q \in k[X]$, i.e. $p (X-u)$ is a polynomial over $k$ with root $u$. QED
In particular, if $K/k$ is algebraic, we have $[K(X):k(X)] = [K:k]$.
A: There is also a more elementary argument explaining why $v_{1},\ldots, v_{n}$ spans $K(X)/k(X)$. To understand it one doesn't need to know separable field extensions nor integral ring extensions, only a little bit of linear algebra:
Let $E = span_{k(X)} \lbrace v_{1},\ldots, v_{n}\rbrace$. Note that $K[X]\subset E$ implies $K[X]E\subset E,\ 1\in E$, as $v_{1},\ldots, v_{n}$ is a basis of $K/k$.
Take an arbitrary $h\in K[X]$.
Then 
$\cdot h:K(X)\ni a\mapsto a\cdot h\in K(X)$ 
is an isomorphism of linear spaces over $k(X)$ ($h^{-1}$ defines inverse linear mapping $\cdot h^{-1}$). Furthermore $\cdot h(E)\subset E$ as $K[X]\subset E$. 
Hence 
$\cdot h|_{E}: E\to E$
is a monomorphism of finite dimensional linear spaces over $k(X)$, so in fact an isomorphism.
Therefore $\cdot h^{-1}|_{E}:E\to E$
In particular $(\cdot h^{-1})(1) = h^{-1}\in E$, and $gh^{-1}\in E$ for every $g\in K[X]$.
A: Here is what I believe I understand of the other answers. 
Let $K/k$ be an extension and $X$ an indeterminate. We identify $k(X)\otimes_kK$ with $k(X)\otimes_{k[X]}K[X]$, and denote this domain by $A$. Everything will follow from the 

OBSERVATION. Any element of $A$ can be written as 
  $$\frac{1}{p(X)}\otimes P(X)$$ with $p(X)$ in $k[X]$, $p(X)\not=0$, $P(X)$ in $K[X]$. Its image in $K(X)$ is $P(X)/p(X)$. In particular, the natural map from $A$ to $K(X)$ is injective. Thus we can (and will) view $A$ as the subdomain of $K(X)$ formed by the elements which can be written, in the above notation, as $P(X)/p(X)$. 

The fraction field of $A$, regarded as a subfield of $K(X)$, is called the compositum of $k(X)$ and $K$. It is denoted $k(X)K$, and coincides with $K(X)$. 
If $a$ is in $K$ and $1/(X-a)$ is in $A$, then $a$ is algebraic over $k$. So, $A$ is not a field if $K/k$ is transcendental. 
If $K/k$ has finite degree, the domain $A$, being finite dimensional over $k(X)$, is a field, and is thus equal to $K(X)$. The same conclusion holds if $K$ is a union of finite degree extensions of $k$, that is, if $K/k$ is algebraic. 
A: The missing step is to show that $v_1,\ldots,v_n$ is linearly independent over $k(x)$.  So suppose that there exist rational functions $r_1(x),\ldots,r_n(x)$, not all the zero function, such that
$r_1(x) v_1 + \ldots + r_n(x) v_n = 0$.
We may write $r_i(x) = n_i(x)/d(x)$, i.e., let $d(x)$ be a common denominator of the rational functions.  Multiplying through by $d(x)$, we get a polynomial dependence relation
$n_1(x) v_1 + \ldots + n_n(x) v_n = 0$.
Now let $N(x)$ be the greatest common divisor of $n_1(x),\ldots,n_r(x)$.  (Such things exist since the polynomial ring $k[x]$ has a division algorithm, hence is a Unique Factorization Domain.)  Dividing through by $N(x)$, we get, say,
$N_1(x) v_1 + \ldots + N_n(x) v_n = 0$,
with $\operatorname{gcd}(N_1,\ldots,N_n) = 1$.  In particular, not all of the $N_i$'s are divisible by $x$, so plugging in $x = 0$ gives a nontrivial linear dependence relation
$N_1(0) v_1 + \ldots + N_n(0) v_n = 0$
over $k$, a contradiction.
In more sophisticated language, we are showing that the extensions $K/k$ and $k(x)/k$ are linearly disjoint.  This can be rephrased in terms of tensor products, for  instance...but in the end the above proof is the simplest I can think of.
Added: Robin Chapman and Steve D are right: I misread the question and thought that the OP had already worked out that a basis $v_1,\ldots,v_n$ of $K/k$ also spans $K(x)$ over $k(x)$, but in fact this is the hardest part of the argument.  As the OP says, it is easy to see that the set of all $k(x)$-linear combinations of the $v_1,\ldots,v_n$ contains all elements of $K[x]$.  As Robin says, it is enough to show that this span also contains all elements $\frac{1}{Q(x)}$ with $Q(x) \in K[x] \setminus \{0\}$, and a nice way to see this is to show that every $Q \in K[x]$ divides some nonzero polynomial $q \in k[x]$, for if $Q(x) g(x) = q(x)$, $\frac{1}{Q} = = \frac{1}{q} \cdot g(x)$.
Robin gives a nice argument for this: essentially he extends the norm map from a finite dimensional field extension to polynomials.  I might as well complete my answer, and I might as well do it in a different way, so here goes:
It is enough to assume that $Q$ is irreducible in the UFD $K[x]$, i.e., that $\mathcal{P} = (Q)$ is a prime ideal.  Put $\mathfrak{p} = \mathcal{P} \cap k[x]$.  In great generality, the restriction of a prime ideal to a subring is again a prime ideal (this is even true for the preimage of a prime ideal under an arbitrary ring homomorphism, and is very easy to show).  What we want to show is that $\mathfrak{p} \neq 0$.  But $K[x]$ is a free $k[x]$-module of dimension $n = [K:k]$.  In particular, the extension $K[x] / k[x]$ is finitely generated as a module, hence an integral extension, and in such an extension any maximal ideal pulls back to a maximal ideal.  So $\mathfrak{p}$ is maximal, hence nonzero.
These facts follow immediately from the definition of integral extensions: see e.g. Proposition 160 and Corollary 168 of
http://alpha.math.uga.edu/~pete/integral.pdf.
Note that a possible virtue of this argument is that one does not need to treat the separable and inseparable cases differently.
A: This is quite a subtle problem, and there are important differences between
the finite extension and infinite extension cases. The key is to show
that $v_1,\ldots,v_n$ form a $k(X)$-basis of $K(X)$. Pete has dealt with
their linear indepdendence but it remains to show that their $k(X)$-span is
$K(X)$.
Let $f\in K(X)$. Then $f=g/h$ where $g$ and $h$ are polynomials over $K$. The key
is that there is a non-zero polynomial $h_1$  with coefficients in $k$
such that $h\mid h_1$. In the separable case one can take $h_1$ be
the product of Galois conjugates of $h$; in general one may need to take
a positive power of that. The upshot is that $f=g_1/h_1$ where $h_1$
has coefficients in $k$. This reduces the problem to showing that $g_1$
is in the $k(X)$-span of the $v_i$, which you have already done.
The subtlety is that this breaks down for infnite non-algebraic extensions.
If $a\in K$ is transcendental over $k$ then $1/(X+a)$ is not in the $k(X)$-linear
span of the elements of $K$. In short, even though $K$ and $k(X)$ are
linearly disjoint over $k$, $K(X)\ne K\cdot k(X)$ in this case.
Added (15/9/2010)
The real distinction isn't between finite and infinite extensions
(as I said above)
but rather between algebraic and transcendental extensions. To summarize:
the natural map
$$K\otimes_k k(X)\to K(X)$$
is always injective, and is surjective if and only if $K/k$ is
an algebraic extension.
