On proving Hadamard’s Determinant Inequality (using Weierstrass Theorem) Hadamard's determinant inequality for matrices states:
Let $X = \left[ x_{ij} \right]$ be a real $n \times n$ matrix with $| x_{ij} | \leq 1$ for all $i$ and $j$. Then
$$
| \mbox{det}(X) | \leq n^{n \over 2} \tag{1}
$$
and equality is attained in (1) if and only if $X$ is a Hadamard matrix.
(A  Hadamard matrix $H$ is an $n \times n$ matrix whose entries are $\pm 1$ that
satisfies the equation $H^T H = H H^T = n I$.)
In 2014, Kenneth Lange showed that Hadamard's inequality can be established using Weierstrass' extreme value theorem. Details were too brief for me, and I have given a link for this paper at the end of this question.
We can take
$$
f(X) = | \mbox{det}(X) |, \ \ \mbox{where} \ \ X \in \mathcal{M}^{n,n}
$$
and show that $f$ is a continuous function from $\mathcal{M}^{n,n}$ to $\mathbf{R}$.
What is the compact subset $S$ of $\mathcal{M}^{n,n}$ that we need to take for the Weierstrass theorem? I like to know more details.
I also like to know how to establish the equality case in the Hadamard's inequality (3).
I have added a link to the paper I cited:
Kenneth Lange: Hadamard’s Determinant Inequality (2014)
Am Math Mon. 2014 Mar 1; 121(3): 258–259.
[This is a very quick proof, but I wish to understand it clearly..]
Kenneth Lange paper
Kenneth Lange paper (2014) - Hadamard's determinant inequality
 A: Hadamard's inequality for real $n\times n$ matrices $X = (x_1, \ldots, x_n)$ states that
$$ \tag{$*$}
 |\det(X)| \le \prod_{j=1}^n \Vert x_j \Vert
$$
where $\Vert x_j \Vert$ denotes the Euclidean norm of the column vectors $x_j \in \Bbb R^n$.
In particular, if all entries in $X$ satisfy $| x_{ij} | \leq 1$ then $\Vert x_j \Vert \le \sqrt n$ for all $j$, and $|\det(X)|  \le n^{n/2}$ follows.
Now the idea is to prove $(*)$ for the case that all column vectors have unit length ($\Vert x_j \Vert = 1$) because that can always achieved by scaling (unless a column vector is zero, but then the determinant is zero as well).
So we will determine the maximum of $f(X) = |\det(X)|$ on the set
$$
S = \{ X = (x_{ij}) \in \Bbb R^{n \times n} \mid x_{1j}^2 + x_{2j}^2 + \cdots + x_{nj}^2 = 1 \text{ for } 1 \le j \le n\} \, .
$$
That is a compact subset of $\Bbb R^{n \times n}$, so that the continuous function $f$ attains its maximum on $S$.
Then it is claimed that if $f$ attains its maximum at $X_0$ then $X_0$ is necessary an orthogonal matrix. Since orthogonal matrices have determinant $\pm 1$, the conclusion $(*)$ follows.
That $X_0$ is necessarily orthogonal is proved by contradiction: If $f$ attains its maximum on $S$ at $X_0 = (x_1, x_2, \ldots, x_n)$ where (say) $x_1$ and $x_2$ are not orthogonal then
$$
 Y = (ax_1 + bx_2, x_2, \ldots, x_n) 
$$
with
$$
a = \frac{1}{\sqrt{1-(x_1^T x_2)^2}} \, , \,
b = \frac{-x_1^T x_2}{\sqrt{1-(x_1^T x_2)^2}}
$$
has also column vectors of unit length, but
$$
 f(Y) = |\det(Y)| = |a|\cdot |\det(X_0)| > |\det(X_0)| = f(X_0)
$$
in contradiction to the assumption that $f$ attains its maximum at $X_0$.
The cited paper actually does all this for complex matrices. The proof is the same with “orthogonal” replaced by “unitary” and $x_1^T x_2$ replaced by $|x_1^* x_2|$.
