Transcendental extension, rational functions and field tower

Here is an approach that looks different from Jeremy Daniel's one, so may be worth writing:

The idea is simply that $y$ being transcendental over $K$, it acts as a free variable, and by Gauss Lemma, reducibility in $K(y)[t]$ is equivalent to reducibility in $K[y][t]$, the polynomial ring in variables $y,t$.

Let $y := f(x)/g(x) \in K(x)$, with not both $f,g$ in $K$, so that $y\notin K$. Let $p(t) := f(t) - yg(t) \in K(y)[t]$.

$x$ is transcendental on $K$: By construction.

$x$ is algebraic on $K(y)$: Since $p(x) = 0$.

$y$ is transcendental on $K$: By multiplicativity of degrees of extensions: $$ \underbrace{[K(x):K]}_{\infty} = \underbrace{[K(x):K(y)]}_{<\infty}[K(y):K]. $$

The polynomial $p(t)$ has degree $n:=\max(\deg f,\deg g)$: Since the coefficients of $f$ and $g$ don't cancel out (if $f(t) =\sum_i a_i t^i$ and $g(t) = \sum_i b_i t^i$, then $f(t) + yg(t) = \sum_i (a_i + yb_i)t^i$, and $y\notin K$ implies that $a_i + yb_i =0$ iff both $a_i,b_i=0$).

The goal is to show that $p(t)$ is irreducible in $k(y)[t]$, which will imply it is the minimal polynomial for $x$, hence the degree of $x$ is equal to $n$.

$p$ is reducible in $K(y)[t]$ iff it is in $K[y][t]$: By Gauss Lemma, since $K(y)$ is the field of fractions of $K[y]$.

$K[y][t]$ is the ring of polynomial in two variables over $K$: Obvious since $y$ is transcendental over $K$.

Now, we consider the polynomial $p(y,t) = f(t) + yg(t) \in K[y,t]$. If it is reducible, say $h(y,t)k(y,t) = p(y,t)$, then necessarily the "$y$-degree" (=highest occurence of $y$ -- I don't know the usual term) of $h$ is $0$, and that of $k$ is $1$ (wlog), so we may write $h(y,t) = h(t)$ and $k(y,t) = k_1(t) + yk_2(t)$. Multiplying this yields: $$ h(t)k_1(t) + yh(t)k_2(t) = f(t) + yg(t), $$ and by comparing coefficients, $$ h(t)k_1(t) = f(t),\qquad h(t)k_2(t) = g(t), $$ hence $h$ divides both $f$ and $g$, contradicting coprimality.