In Matt L's answer he states that an ideal phase shifter with a phase shift $\theta$ has a frequency response
$$ H(\omega)= \begin{cases} e^{-j\theta},&\omega>0 \\ e^{j\theta},&\omega<0 \end{cases} $$
But what about DC and Nyquist? If I want to shift the phase of a real-valued signal $x[n]$, I suppose to get another real-valued signal $y[n]$ rather than a complex-valued signal. So $H(\omega)$ should be real at DC and Nyquist (actually in discrete world, $H[k]$) as well as $X(\omega)$ and $Y(\omega)$.
If we just let the frequency responses at these two frequencies equal to $1$, I can simply come up with an anti example that $\theta=\pi$, in which case $y[n] = -x[n]$, $Y(\omega) = -X(\omega)$ and thus $H(\omega) = -1$ for all frequencies.
Can anyone point my mistake out, thanks.