$$E(X)=\sum_{k=1}^{n-2} \frac{\left(\begin{array}{c} n-k \\ 2 \end{array}\right)}{\left(\begin{array}{c} n-1 \\ 2 \end{array}\right)}$$
This is an equation from MIT OCW https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/assignments/MIT18_05S14_ps2_solutions.pdf. The solution for problem 5.
It says that "One can show (after a bit of algebra) that this sum is equal to n/3.". But I don't know how to do it.
A short calculation goes like this:
$$\begin{align*} \sum_{k=1}^{n-2}\frac{\binom{n-k}2}{\binom{n-1}2}&=\binom{n-1}2^{-1}\sum_{k=1}^{n-2}\binom{n-k}2\\ &\overset{*}=\binom{n-1}2^{-1}\binom{n}3\\ &=\frac2{(n-1)(n-2)}\cdot\frac{n(n-1)(n-2)}6\\ &=\frac{n}3\;, \end{align*}$$
where the starred step uses the hockey stick identity.
Alternatively, but more laboriously, one can
$$\begin{align*} \sum_{k=1}^{n-2}\binom{n-k}2&=\sum_{k=2}^{n-1}\binom{k}2\\ &=\frac12\sum_{k=2}^{n-1}k(k-1)\\ &=\frac12\sum_{k=2}^{n-1}(k^2-k)\\ &=\frac12\sum_{k=2}^{n-1}k^2-\frac12\sum_{k=2}^{n-1}k\\ &=\frac12\left(\frac{(n-1)n(2n-1)}6-\frac{(n-1)n}2\right)\\ &=\frac1{12}\big(2n^3-3n^2+n-3n^2+3n\big)\\ &=\frac16n(n-1)(n-2)\;, \end{align*}$$
using only a couple of summation identities found in most freshman calculus courses.
Finally, one can rewrite the identity as
$$3\sum_{k=1}^{n-2}\binom{n-k}2=n\binom{n-1}2$$
and then as
$$3\sum_{k=2}^{n-1}\binom{k}2=n\binom{n-1}2\tag{1}$$
and argue combinatorially as follows.
Suppose that you have players with jerseys numbered from $1$ through $n$, and you want to choose from them a team of $3$ players and appoint one of the $3$ to be captain. There are $n$ ways to choose the captain, and after that there are $\binom{n-1}2$ ways to choose the other $2$ team members from the remaining $n-1$ players, so there are $n\binom{n-1}2$ ways to form a team and appoint its captainn.
Alternatively, we could ask how many ways there are to form a team and appoint its captain if the highest-numbered player on the team is number $k+1$. Then we must choose the other $2$ players from the $k$ players numbered $1$ through $k$, which we can do in $\binom{k}2$ ways; and after that, we can pick any of the $3$ to be the captain, so there are $3\binom{k}2$ ways to pick such a team and appoint its captain. Clearly $k$ must be at least $2$ and at most $n-1$, so the total number of possible teams with appointed captains is $\sum_{k=2}^{n-1}3\binom{k}2=3\sum_{k=2}^{n-1}\binom{k}2$, proving $(1)$.