I have an exercise from my professor;
For the function $f(x)=x^2$, for all $x\in \mathbb{R}$, describe the equivalence relation determined by $f$.
So we are working in the set $\mathbb{R}$, so $x\sim y$ if $f(x)=y, \forall x,y \in \mathbb{R}$? I've worked with some equivalence relations before, but the relation has been given to be. We need $x\sim x, x\sim y \Rightarrow y\sim x,$ and $x\sim y, y\sim z \Rightarrow x\sim z$. This doesnt seem right.....
Or are we looking at a case where $x\sim y$ if $f(x)=f(y)?$ Then the partition generated by $f$ would be $\{0,\{-a,a\}\},a\in \mathbb{R^+}?$
I think your second version is correct. Said differently, the equivalence classes are exactly the sets $f^{-1}(y)$ for $y\in \text{Im}(f)$, that is, for $y\geq 0$.