The electric potential energy of a system of point charges is the work required to assemble the charges from infinity to their given configuration. It is mathematically expressed as
\[
U = \sum_{i<j} \frac{k_e q_i q_j}{r_{ij}},
\]
where \(q_i\) and \(q_j\) are the charges and \(r_{ij}\) is the distance between them. In the given figure, four charges are placed at the corners of a square of side \(a\), with \(+q\) at the top left, \(-q\) at the top right, \(+q\) at the bottom right, and \(-q\) at the bottom left.
For the interactions between adjacent charges separated by a distance \(a\), each pair consists of unlike charges, so the potential energy contribution from each side is \(-\frac{k_e q^2}{a}\). Since there are four sides, the total contribution from adjacent charges is \(-\frac{4 k_e q^2}{a}\).
Next, consider the interactions along the diagonals, where the distance between charges is \(\sqrt{2}a\). Along one diagonal, we have two like charges, giving a positive contribution of \(\frac{k_e q^2}{\sqrt{2}a}\) each, while along the other diagonal, the charges are unlike, giving a negative contribution of \(-\frac{k_e q^2}{\sqrt{2}a}\) each. When summed, these diagonal contributions cancel out to zero.
Therefore, the total electric potential energy of the system is obtained by adding the adjacent and diagonal contributions:
\[
U_{\text{total}} = -\frac{4 k_e q^2}{a}.
\]
Hence, the total potential energy of the system of charges arranged at the corners of the square is negative, equal to \(-\frac{4 k_e q^2}{a}\).