Solution (source code)

= Solution

\b[An infinite-dimensional reflexive example is $\ell^2$], by the <Riesz representation theorem>.

The <weak topology> on $X$ is the coarsest topology making every $f\in X^*$ continuous. The <weak-star topology> on $X^*$ is the coarsest making every evaluation $f\mapsto f(x)$, $x\in X$, continuous. In each case basic neighborhoods impose finitely many evaluation inequalities. The <Banach-Alaoglu theorem> states that the <closed unit ball> of a dual space is compact for its <weak-star topology>. The separation theorem needed here says: if $K$ is a nonempty weak-star compact <convex> subset of a dual space $E^*$ and $z\notin K$, then some $e\in E$ strictly separates them,
$$
\operatorname{Re}z(e)>\sup_{k\in K}\operatorname{Re}k(e).
$$
The real-part convention covers complex spaces; for real spaces omit it.

Let $K$ be the weak-star closure of $J_X(B_X)$ inside $B_{X^{**}}$. This is compact by Banach-Alaoglu, <convex>, and nonempty. If $z\in B_{X^{**}}\setminus K$, separation in the dual pair $(X^{**},X^*)$ gives $f\in X^*$ with
$$
\operatorname{Re}z(f)>\sup_{x\in B_X}\operatorname{Re}f(x)=\|f\|.
$$
But $|z(f)|\leq\|z\|\|f\|\leq\|f\|$, a contradiction. Therefore $K=B_{X^{**}}$, proving the required <Goldstine theorem> density.

If $X$ is reflexive, $J_X$ identifies its <weak topology> with the <weak-star topology> of $X^{**}$ and carries $B_X$ onto $B_{X^{**}}$, so Banach-Alaoglu gives weak compactness. Conversely, if $B_X$ is weakly compact, its image is weak-star compact, hence closed in the <Hausdorff> bidual topology. Density then forces $J_X(B_X)=B_{X^{**}}$. Scaling gives surjectivity on the entire bidual. Thus
$$
\boxed{B_X\text{ weakly compact}\iff X\text{ reflexive}.}
$$