Extremal of Compact Banach Space Embedding Let $(X, \|\cdot \|_X)$ and $(Y,\|\cdot \|_Y)$ be (nontrivial real) Banach spaces such that $X \subseteq Y$ .
We say $X$ is compactly embedded into $Y$ if the following two conditions hold :

*

*There exists a constant $C>0$ such that $\| x\|_Y \leq C\|x \|_X$ for every $x \in X$ .

*If a sequence $\{x_n\}_{n \geq 1} \subseteq X$ is bounded with respect to the norm $\|\cdot \|_X$, then its closure in $Y$ is a compact subset of $Y$.

The best constant $C$ is given by:
\begin{equation*}
C = \inf_{x \in X, x \neq 0} \frac{\| x\|_Y}{\| x\|_X}
\end{equation*}
Suppose $X$ is compactly embedded into $Y$. Does it follow that the above best constant is attained? That is, does there exist a nonzero element $x \in X$ such that $C= \frac{\| x\|_Y}{\| x\|_X}$? If not, under what additional assumption will such an extremal element exist?
My attempt:
For each positive integer $n$, there exists a nonzero element $x_n \in X$ such that:
\begin{equation*}
C \leq \frac{\| x_n\|_Y}{\| x_n\|_X} < C + \frac{1}{n}
\end{equation*}
Put $y_n = \frac{x_n}{\| x_n\|_X}$. Then $y_n \in X$, $\| y_n\|_X=1$, and:
\begin{equation*}
C \leq \frac{\| y_n\|_Y}{\| y_n\|_X}=\| y_n\|_Y < C + \frac{1}{n}
\end{equation*}
By property $2$, there is a $y \in Y$ and a subsequence $\{n_k\}_{k\geq 1}$ such that $y_{n_k} \to y$ as $k \to \infty$ with respect to the $\| \cdot \|_Y$ norm. By continuity of norm and squeeze theorem, we have $\| y \|_Y = C>0$ so that $y \neq 0$ .
Now all I need to prove is that $y \in X$. But I am stuck on this step. Clearly $\{y_{n_k}\}_{k \geq 0}$ is a Cauchy sequence in $\| \cdot \|_Y$ but I have no idea about how to make it Cauchy in $X$ . On the other hand, I am unable to come up with counterexamples .
 A: First, let's record a Lemma.
Lemma.
Given $X,Y$ Banach spaces with $X$ reflxive, and $T:X\to Y$ a compact operator. Suppose the sequence $x_n\in X$ weakly converges to $x_\infty$, then $Tx_n$ strongly converges to $Tx_\infty$.
Proof: By the uniform boundedness principle, $x_n$ is norm bounded (reflexivity means weak and weak* are the same). Therefore $Tx_n$ is a bounded sequence in $Y$ and has a converging subsequence $Tx_{n_k}$ that converges to $y_\infty\in Y$.
Now, choose $\varphi\in Y^*$. The adjoint operator $T^*: Y^*\to X^*$ is continuous, and we have
$$ \varphi(Tx_n) = T^*\varphi(x_n) \to T^*\varphi(x_\infty) = \varphi(Tx_\infty) $$
by weak convergence of $x_n$. This shows that $Tx_\infty$ is a weak limit of $Tx_n$, and hence also a weak limit of $Tx_{n_k}$. But since strong limits are weak limits, we have that by the uniqueness of weak limits that $Tx_\infty = y_\infty$.
So far we have only proven convergence along a subsequence. To prove that the convergence holds for the original sequence, note that we can apply the same argument to every subsequence of the original sequence $x_n$. This shows that "every subsequence of $Tx_n$ has a further subsequence that converges strongly to $Tx_\infty$", which implies (standard exercise) that $Tx_n \to Tx_\infty$. Q.E.D.

Returning to your question, when $X$ is reflexive, given your maximizing sequence $x_n$ with constant $\|x_n\|_X = 1$ and
$$ \frac{\|x_n\|_Y}{\|x_n\|_X} \nearrow C = \sup \frac{\|x\|_Y}{\|x\|_X} $$
By Banach-Alaoglu we can WLOg assume this sequence weakly converges to $x_\infty$. By the Lemma we know that $\|x_\infty\|_Y = C$. It suffices to show that $\|x_\infty\|_X = 1$.
Using the dual characterization we have that
$$ \|x_\infty\|_X = \sup_{z\in X^*, \|z\|_{X^*} = 1} x_\infty(z) $$
By weak (weak*) convergence, we have
$$ x_\infty(z) = \lim x_n(z) \leq \|x_n\|_X \|z\|_{X^*} = 1 $$
Hence we have $\|x_\infty\|_X \leq 1$. It suffices to show that it is impossible for $\|x_\infty\|_X < 1$.
This final step holds because, were it the case that $\|x_\infty\|_X < 1$, then by our argument we've shown that $\|x_\infty\|_Y / \|x_\infty\|_X > C$, contradicting the fact that $C$ is the optimum constant (the supremum).

Remark: much of this proof can be adapted to pick up where you left off in your attempt, after you fixed the mistake between inf and sup. However, notice that nowhere did I assert that $x_n$ converges strongly to $x_\infty$. All I did is prove that $x_\infty$ has norm 1.
Remark 2: this proof relies on multiple spots that $X$ is reflexive. Some of them are possibly gratuitous. (I think the Lemma above doesn't really require reflexivity.) However, Banach-Alaoglu only gives you weak*, and to apply the Lemma I do need to pass to weak convergence, so off hand I don't know whether the argument can be extended to when $X$ is not reflexive.
A: The claim is not true without reflexivity.
Or at least not true if the spaces have no pre-dual.
Take
$$
Y = L^1(0,1)
$$
and
$$
X = \{ u \in W^{1,1}(0,1): \ u(0)=0\}.
$$
Note that functions in $X$ satisfy the estimate
$$
|u(t)| \le \|u'\|_{L^1} \quad\forall t\in (0,1).
$$
Then one can check that $\|u\|_X:= \|u'\|_{L^1(0,1)}$ is a norm on $X$,
and
$$
\|u\|_Y=\|u\|_{L^1} \le \|u'\|_{L^1}=\|u\|_X \quad \forall u\in X.
$$
The constant $C=1$ is the best possible: Define $u_n=\min(nx,1)\in X$. Then $\|u_n\|_X=1$ and $\|u_n\|_Y=1-\frac1{2n}$.
But there is no $u\in X\setminus\{0\}$ such that $\|u\|_X=\|u\|_Y$:
Assume $u\in X$ such that $1 = \|u\|_{L^1}=\|u'\|_{L^1}$.
Then $|u(t)|\le 1$, and $\|u\|_{L^1}=1$ only if $u$ is identical one, which violates $u(0)=0$.
