I am looking for canonical examples of open and closed equivalence relations, especially ones that are generated by a continuous functions. Intuitively I think that an open /closed continuous function $f:X \rightarrow Y$ should also generate a closed/open equivalence relation by $x R y :\Leftrightarrow f(x)=f(y)$. Is this true? Or are there other ways to construct typical candidates of such relations by using continuous functions?
Every $G_\delta$ equivalence relation $E$ on a standard Borel space $X$ is so called smooth, which means that there is a Borel function $f : X \rightarrow X$ such that $x \ E \ y$ if and only if $f(x) = f(y)$.
All closed and open sets are $G_\delta$ hence if you weaken continuous function to Borel functions, in some sense the method you described above is the only way to get such equivalence relations.