Let $f:\mathbb{Z} \to \mathbb{N}$ and $g:\mathbb{N} \to \mathbb{N}$ be functions. And let $R$ be a equivalence relation on $\mathbb{Z}$, defined by: $$xRy \Leftrightarrow f(x)=f(y)$$
For any $x,y \in \mathbb{Z}$ prove,
$$[x]_{R}=[y]_{R} \Rightarrow g(f(x))=g(f(y))$$
My thought was,
If $[x]_{R}=[y]_{R}$ then one have $xRy$, and so $f(x)=f(y)$. The implication that is asked to prove can be writen as: $$f(x)=f(y) \Rightarrow g(f(x))=g(f(y))$$
Suppose that $f(x)=f(y) $ is true. Let $f(x)=f(y)=z \in \mathbb{N}$. So, $g(f(x))=g(f(y))=g(z)$.
Is this proof right? Thanks.