Here is an alternate proof of the identity given by metamorphy:
\begin{equation}
\sum_{k=0}^{n-1}\csc\left(x+\frac{k\pi}n\right)\csc\left(y+\frac{k\pi}n\right)=\frac{n\sin [n(x-y)]}{\sin(x-y)\sin nx\sin ny}
\end{equation}
Let $S(x,y)$ be the above sum. If $y$ is not of the form $y=\frac{k\pi}{n}$, note that $S$ is a $2\pi$-periodic meromorphic function of $x$ with simple poles at $x=\frac{k\pi}{n}$ for each integer $k$ with corresponding residues given by
\begin{equation}
\text{Res}\left(S,x=\frac{k}{n}\right)=
\csc\left(y-\frac{k\pi}{n}\right)
\end{equation}
Now, note that the function
\begin{equation}
f(x,y)=\frac{n\sin [n(x-y)]}{\sin(x-y)\sin nx\sin ny}
\end{equation}
is also a $2\pi$-periodic meromorphic function of $x$ with simple poles at $x=\frac{k\pi}{n}$ for each integer $k$ with corresponding residues given by
\begin{equation}
\text{Res}\left(f,x=\frac{k}{n}\right)=(-1)^k\frac{n\sin [n(\frac{k\pi}{n}-y)]}{\sin(\frac{k\pi}{n}-y)\sin ny}=
\csc\left(y-\frac{k\pi}{n}\right)
\end{equation}
This implies that $S-f$ is analytic and $2\pi$-periodic in $x$, and since $S-f$ vanishes as $\mathfrak{I}(x)\rightarrow\pm\infty$, then $S-f$ is bounded. Therefore by Louville's theorem, $S-f$ is constant with respect to $x$. By the same logic, $S-f$ is constant with respect to $y$, and thus, $S-f$ is constant. Finally, since $S-f$ vanishes as $\mathfrak{I}(x)\rightarrow\pm\infty$, then $S-f$ is precisely $0$, which completes the proof.