Let’s describe an example of a field K which is of degree 2 over two distinct subfields M and N respectively, but not algebraic over M∩N.
Let K=F(x) be the rational function field over a field F of characteristic 0, M=F(x2) and N=F(x2+x). I claim that those fields provide the example we’re looking for.
K is of degree 2 over M and N
The polynomial μM(t)=t2−x2 belongs to M[t] and x∈K is a root of μM. Also, μM is irreducible over M=F(x2). If that wasn’t the case, μM would have a root in F(x2) and there would exist two polynomials p,q∈F[t] such that p2(x2)=x2q2(x2) which cannot be, as can be seen considering the degrees of the polynomials of left and right hand sides. This proves that [K:M]=2. Considering the polynomial μN(t)=t2−t−(x2+x), one can prove that we also have [K:N]=2.
We have M∩N=F
The mapping σM:x↦−x extends uniquely to an F-automorphism of K and the elements of M are fixed under σM. Similarly, the mapping σN:x↦−x−1 extends uniquely to an F-automorphism of K and the elements of N are fixed under σN. Also (σN∘σM)(x)=σN(σM(x))=σN(−x)=−(−x−1)=x+1. An element z=p(x)/q(x)∈M∩N where p(x),q(x) are coprime polynomials of K=F(x) is fixed under σM∘σN. Therefore following equality holds p(x)q(x)=z=(σ2∘σ1)(z)=p(x+1)q(x+1), which is equivalent to p(x)q(x+1)=p(x+1)q(x). By induction, we get for n∈Z p(x)q(x+n)=p(x+n)q(x). Assume p(x) is not a constant polynomial. Then it has a root α in some finite extension E of F. As p(x),q(x) are coprime polynomials, q(α)≠0. Consequently p(α+n)=0 for all n∈Z and the elements α+n are all distinct as the characteristic of F is supposed to be non zero. This implies that p(x) is the zero polynomial, in contradiction with our assumption. Therefore p(x) is a constant polynomial and q(x) also according to a similar proof. Hence z is constant as was supposed to be proven.
Finally, K=F(x) is not algebraic over F=M∩N as (1,x,x2,…,xn,…) is independent over the field F which concludes our claims on K,M and N.