TITLE: A conjecture involving roots of unity
QUESTION [6 upvotes]: Motivated by Kevin Liu's recent question, here I pose the following conjecture based on my numerical computation.
Conjecture. Let $m>1$ and $n>1$ be integers. Let $\delta\in\{0,1\}$ and let $\zeta$ be a primitive $(m(n-\delta)-(-1)^{\delta})$-th root of unity. Then, for the sum
$$S:=\sum_{k=1}^{n-1}\left(\frac{\zeta^k}{1+\zeta^{km}}-(-1)^{n-k+\delta}\frac{\zeta^k}{1-\zeta^{km}}\right),$$
its real part is 
$$\text{Re}(S)=(-1)^{n-1}\left\lfloor \frac n2\right\rfloor.$$
The case $\delta=1$ of the conjecture might be handled by the method of Fedor Petrov used in his solution of Liu's question, but the case $\delta=0$ looks challenging. Your comments are welcome!

REPLY [3 votes]: Motivated by Nemo's solution in the case $\delta=0$, here I provide a proof for the case $\delta=1$. Let $\zeta$ be a primitive $m(n-1)+1$-th root of unity, and consider
$$S=\sum_{k=1}^{n-1}\left(\frac{\zeta^k}{1+\zeta^{km}}+(-1)^{n-k}\frac{\zeta^k}{1-\zeta^{km}}\right) = \sigma_1+(-1)^n\sigma_2,$$ where 
$$\sigma_1=\sum_{k=1}^{n-1}\frac{\zeta^k}{1+\zeta^{km}}\ \ \text{and}\ \ \sigma_2=\sum_{k=1}^{n-1}(-1)^k\frac{\zeta^k}{1-\zeta^{km}}.$$
As $\zeta=\zeta^{m(1-n)}$, we have
\begin{align}\sigma_2=&\sum_{k=1}^{n-1}(-1)^k\frac{\zeta^{km(1-n)}}{1-\zeta^{km}}
=\sum_{k=1}^{n-1}(-1)^k\frac{1+\zeta^{-kmn}-1} {\zeta^{-km}-1}
\\=&\sum_{k=1}^{n-1}\frac{(-1)^k}{\zeta^{-km}-1}+\sum_{k=1}^{n-1}(-1)^k\sum_{s=0}^{n-1}(\zeta^{-km})^s
\\=&\sum_{k=1}^{n-1}\frac{(-1)^k}{\zeta^{-km}-1}+\sum_{s=0}^{n-1}\left(\frac{1-(-\zeta^{-ms})^n}{1+\zeta^{-ms}}-1\right).
\end{align}
Noting $\zeta^{mn}=\zeta^{m-1}$, we see that
\begin{align}\sigma_2=&\sum_{k=1}^{n-1}\frac{(-1)^k}{\zeta^{-km}-1}-\sum_{s=0}^{n-1}\frac{\zeta^{-ms}(1+(-1)^n\zeta^s)}{1+\zeta^{-ms}}
\\=&\sum_{k=1}^{n-1}\frac{(-1)^k}{\zeta^{-km}-1}-\sum_{s=0}^{n-1}\frac1{1+\zeta^{sm}}-(-1)^n\left(\sigma_1+\frac12\right)
\end{align}
and hence 
$S=(-1)^nT-1/2$, where 
$$T=\sum_{k=1}^{n-1}\frac{(-1)^k}{\zeta^{-km}-1}-\sum_{s=0}^{n-1}\frac1{1+\zeta^{sm}}.$$
Clearly,
\begin{align}2\text{Re}(T)=&\sum_{k=1}^{n-1}\left(\frac{(-1)^k}{\zeta^{km}-1}+\frac{(-1)^k}{\zeta^{-km}-1}\right)-\sum_{s=0}^{n-1}\left(\frac1{1+\zeta^{sm}}+\frac1{1+\zeta^{-sm}}\right)
\\=&\sum_{k=1}^{n-1}(-1)^{k-1}-\sum_{s=0}^{n-1}1=-2\left\lfloor\frac{n-1}2\right\rfloor-1.\end{align}
Therefore
$$\text{Re}(S)=(-1)^n\text{Re}(T)-\frac12=(-1)^{n-1}\left(\left\lfloor\frac{n-1}2\right\rfloor+\frac12\right)-\frac12=(-1)^{n-1}\left\lfloor\frac n2\right\rfloor.$$