Finding The Equivalence Class Okay, so the question I am working on is, "Suppose that A is a nonempty set, and $f$ is a function that has A as its domain. Let R be the relation on A consisting of all ordered pairs $(x, y)$ such that $f(x)=f(y)$.
a)Show that R is an equivalence relation on A.
b)What are the equivalence classes of R?"
I was able to part a, but I am not certain how to answer part b. I know that the domain is the set A, but what is the range? And when you say that $f(x)=f(y)$, does that mean that a function is equal to its inverse? Like for instance, $\Large y=\frac{1}{x}$ 
 A: The equivalence classes are all sets of the form $\{a\in A:f(a)=b\}$ for $b$ in the range of $f$. $f(x)=f(y)$ simply mean that $x$ and $y$ are mapped to the same element, not that the function is its inverse.
A: I will give an  example:
Let $f:\mathbb{R}\to \mathbb{R}$ with $f(x)=x^2$.
Then $x$ is equivalent to $-x$ because $f(x)=f(-x)$.
The equivalence classes are $\bar{x} = \{y \in \mathbb{R}:f(x)=f(y)\}=\{x,-x\}$ for $x \in \mathbb{R}$. Thus the equivalence classes are $\{\bar{x}:x\geq0\}$.
Observe that $\{x,-x\}=f^{-1}\left(\{x\}\right)$. In general the equivalence classes are $\{f^{-1}\left(\{y\}\right): \ y \text{ in range of } f\}$.
A: Let's say that $f$ discriminates $x$ from $y$ if it maps $x$ and $y$ to different objects, i.e. if $f(x) \neq f(y)$. Then the corresponding $R$ relation is defined to hold between $x$ and $y$ when $f$ doesn't discriminate them. 
"When you say that $f(x)=f(y)$, does that mean that a function is equal to its inverse?" Not at all. $f$ can be any function you like here: to repeat, we are just told that the corresponding $R$-relation is defined to hold between $x$ and $y$ just when the function $f$ (whatever it is) happens to map $x$ and $y$ to the same thing, so doesn't discriminate. 
So, as you say, that evidently makes $R$ (i.e. being indiscriminable-by-$f$) an equivalence relation. What are its equivalence classes? Well they must be classes such that objects are in the same class when $f$ doesn't discriminate them. It is as simple as that!
