If you haven't had Lagrange multipliers yet, here is the idea behind them.
If $\{x_i\}_{i=1}^n$ is a critical point, then for every vector $\{u_i\}_{i=1}^n$ so that $ \frac{\mathrm{d}}{\mathrm{d}t}\sum_{i=1}^n(x_i+tu_i)=0\tag{1} $ at $t=0$, we also have $ \frac{\mathrm{d}}{\mathrm{d}t}\sum_{i=1}^n(x_i+tu_i)^2=0\tag{2} $ at $t=0$.
Evaluating $(1)$ and $(2)$, this says that for every $\{u_i\}_{i=1}^n$ so that $ \sum_{i=1}^nu_i=0\tag{3} $ we also have $ \sum_{i=1}^nx_iu_i=0\tag{4} $ This means that $x$ is perpendicular to the space of all vectors that are perpendicular to $v$ where $v_i=1$. This means that $x$ is in the subspace spanned by $v$. Thus, the $x_i$ are all the same, and therefore, $x_i=k/n$.