What must I do to plot the graph of $\sin x=\sin y$ I must represent the domain of the function: $$z=\frac{x-y}{\sin x-\sin y}$$ 
Therefore, $\sin x\neq\sin y$. 
So I must plot $\sin x=\sin y$. How do I do this?

$\sin y = \sin x \iff y = x +2k\pi \text{ or } y = \pi-x+2k\pi,\text{ for some $k\in \mathbb{Z}$}$.
The two equations on the RHS of the equivalence correspond to lines.
Therefore, the set $\{(x,y) \in \mathbb{R}^2 \mid \sin x = \sin y\}$ (over which the function is not defined) is a "crisscross" of such lines; the restriction of that set over $[-40,40]^2$ looks as follows:


$\LaTeX$ code:
\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
 \def\PI{3.1416}
 \begin{axis}[xlabel=$x$, ylabel=$y$,ymin=-40,ymax=40]
  \foreach \k in {-15,...,15}{
   \addplot[red, ultra thin,domain=-40:40] (x,x+2*\PI*\k);
   \addplot[red, ultra thin,domain=-40:40] (x,\PI-x+2*\PI*\k);
  }
 \end{axis}
\end{tikzpicture}
\end{document}

