Let $A \in \mathbb{R}^{n \times n}$ be symmetric and positive definite and let $m < n$. We want to find an orthonormal basis $\{ u_1,..., u_n \}$ of $\mathbb{R}^n$ such that $$ J = \sum_{i=m}^n u_i^T A u_i $$ is minimised.
Apparently the set of eigenvectors of $A$ minimise this expression. Is that true? How could one show this?
It is indeed the case that the set of eigenvectors $u_1,\dots,u_n$ associated with eigenvalues $\lambda_1 \geq \cdots \geq \lambda_n$ minimizes your sum. Note that taking these vectors $u_i$ yields the sum $$ \sum_{i=m}^n u_i^TAu_i = \sum_{i=m}^n \lambda_i. $$ It suffices, then, to prove that the above is a lower bound for the sum for any choice of orthonormal basis of $u_i$. One way to prove that this holds is as follows. The Schur-Horn theorem (or to be precise, a corollary of one direction of the Schur-Horn theorem) tells us that a symmetric matrix $M$ with eigenvalues $\mu_1 \geq \cdots \geq \mu_n$ and diagonal entries $d_1 \geq \cdots \geq d_n$ will necessarily satisfy $$ \sum_{i=m}^n d_i \geq \sum_{i=m}^n \mu_i \qquad m = 1,\dots,n, $$ with equality in the case of $m = n$ (in which both sides are equal to the trace of $M$).
Now, we apply this to your problem. Consider an arbitrary orthonormal basis $u_1,\dots,u_n$. Let $U$ denote the matrix whose columns are $u_1,\dots,u_n$. Let $M$ denote the matrix $$ M = U^TAU = [u_i^TAu_j]_{i,j = 1}^n. $$ $M$ is similar to $A$, so its eigenvalues are $\lambda_1 \geq \cdots \geq \lambda_n$. Let $d_1 \geq \cdots \geq d_n$ denote the diagonal entries of $M$. Applying the Schur-Horn theorem gives us $$ \sum_{i=m}^n u_i^TAu_i = \sum_{i=m}^n M_{i,i} \geq \sum_{i=m}^{n} d_i \geq \sum_{i=m}^{n} \lambda_i, $$ as was desired.