Understanding Equivalence Classes?

Your example is correct, I think you are very close to having it understood fully. Just note that in mod 3 calculations, $\bar{3} = \bar{0}$, so it makes sense that in your particular example, the addition of (the equivalence class of) 3 does not change anything. Similarly, for example $$ \bar{2} + \bar{2} = \overline{2+2} = \bar{4} = \bar{1}, $$ which does make sense as $2+2 = 4 = 1 + 3 = 1 \mod 3$.


You are studying something more complex than equivalence classes on a set: they are congruence classes on a set with structure (in your example on a ring), that is, equivalence classes on which the structure of the structured set is induced. So in your example addition and multiplication of $\Bbb{Z}$ are induced on the family of congruence classes $\Bbb{Z}/n\Bbb{Z}$. Congruence relation are very special case of equivalence relations: it is not always possible to induce structures in this way. The map from the set to the family of congurence classes $\bar a$ is a homomorphism (that is called natural projection homomorphism), and every homomorphism can always be obtained as a composition of a natural projection homomorphism, a bijection and an inclusion map


I'm going to expand on DanielSchepler's comment. This is a bit of a non-answer because it steps back from the question, though see the end. Frankly, though, the approach I'm about to describe more accurately describes how we use quotient sets in most cases than the "set of equivalence classes" approach. (I mean you don't actually think about the rational number $\frac{n}{d}$ as an infinite set of pairs of numbers. You think of it in terms of representatives and then require operations on them to be "well-defined". So $\frac{n}{d}\mapsto d$ is not a well-defined function, but $\frac{n}{d}\mapsto\frac{n^2}{d^2}$ is.)

Instead of (solely) relying on some implicit global notion of equality, we can consider equipping sets with an equivalence relation on the set that will tell you when two elements of the set should be considered "equal". This is called a setoid. I'll write $(S,\approx)$ for a setoid where $S$ is a set and ${\approx}\subseteq S\times S$ is an equivalence relation on $S$. As a very simply example, given a non-empty set $S$, we can consider the setoid $(S,\approx_1)$ where $x\approx_1 y$ holds for all $x,y\in S$. This setoid behaves like a one-element setoid. While $S$ may have more than one element, they are all considered "equal" in this setoid.

The defining property of functions is that they take equal inputs to equal outputs. Adapting this to the setoid context, this means that a function between setoids $f : (S,\cong)\to(T,\simeq)$ is a (normal, set) function $\overline f: S \to T$ which satisfies the property: for all $x,y\in S$, if $x \cong y$ then $\overline f(x)\simeq \overline f(y)$. In this case we say that $\overline f$ is a well-defined function from $(S,\cong)$ to $(T,\simeq)$.

Using the simple example from before, i.e. where $\approx_1$ relates everything to everything else, this means that all inputs must be sent to the "same" (as judged by $\simeq$) output. This is the sense in which that setoid behaves as a one-element setoid.

In this context, quotienting is a straightforward operation: it corresponds to equipping a setoid with a coarser equivalence relation, i.e. one that relates all the same things the original setoid's equivalence relation related but may relate additional things. So $\mathbb{Z}/n\mathbb{Z}$ takes the setoid $(\mathbb{Z},=_\mathbb{Z})$ and produces the setoid $(\mathbb{Z},\approx_n)$ where $x \approx_n y \Leftrightarrow \exists k\in\mathbb{Z}.x - y = kn$. Now, we have the interesting and important fact that addition and multiplication of integers is already a well-defined function with respect to the setoid $(\mathbb{Z},\approx_n)$. (Check it!)

For typical set theories, every setoid, $(S,\approx)$, is isomorphic (in the setoid sense) to another setoid $(S/{\approx},=)$ where ${=}$ is the global equality and $S/{\approx}\equiv\{\{y\mid x\approx y\}\mid x\in S\}$. You should verify that the function $f: (\mathbb{Z},\approx_3)\to(\mathbb{Z}/3\mathbb{Z},=)$ with $\overline f(x) =\{y\approx_3 x\mid y\in\mathbb{Z}\}$ is well-defined; and $g : (\mathbb{Z}/3\mathbb{Z},=)\to(\mathbb{Z},\approx_3)$ with $\overline g(S) = \begin{cases}0,&\text{if }0\in S\\1, &\text{if }1\in S\\2, &\text{if }2\in S\end{cases}$ is well-defined; and, finally, that they are mutual inverses (as functions between setoids, they certainly are not bijections between $\mathbb{Z}$ and $\mathbb{Z}/3\mathbb{Z}$). That is, $\overline f(\overline g(S)) = S$ and $\overline g(\overline f(x))\approx_3 x$. The $\overline a$ in the question would be $\overline f(a)$ here. Indeed, they are asking if $\overline f(a) \stackrel{\cdot}{+} \overline f(b) = \overline f(a+b)$ where $S\stackrel{\cdot}{+}T = \{x+y\mid (x,y)\in S\times T\}$. This is true if and only if $+$ is a well-defined function on $(\mathbb{Z},\approx_3)$.

(I have a blog post that also discusses this.)