Recall that congruences on $A$ can be viewed as certain subalgebras of its square $A^2,\,$ e.g. see here.
In algebras like groups and rings, where we can normalize $\,a = b\,$ to $\,a\!-\!b = \color{#c00}0\,$ congruences are determined by a single congruence class (e.g. an ideal in a ring). This has the effect of collapsing said relationship between congruences with subalgebras from $A^2$ down to $A.\,$ Such algebras are called ideal determined varieties and they have been much studied.
One answer to your question is that ideal-determined varieties are characterized by two properties of their congruences, namely being $\,\rm\color{#c00}{0\text{-regular}}\,$ and $\rm\color{#c00}{0\text{-permutable}}$. Below is an excerpt of one paper on related topics that yields a nice entry point into literature on this and related topics.
On subtractive varieties iv: Definability of principal ideals.
Paolo Agliano and Aldo Ursini
- Foreword
We have been asked the following questions:
- (a) What are ideals in universal algebra good for?
- (b) What are subtractive varieties good for?
- (c) Is there a reason to study definability of principal ideals?
Being in the middle of a project in subtractive varieties,
this seems the right place to address them.
To (a). The notion of ideal in general algebra [13], [17], [22] aims
at recapturing some essential properties of the congruence classes of $0$,
for some given constant $0$. It encompasses: normal subgroups, ideals
in rings or operator groups, filters in Boolean or Heyting algebras,
ideals in Banach algebra, in l-groups and in many more classical
settings. In a sense it is a luxury, if one is satisfied with the
notion of "congruence class of $0$". Thus in part this question might
become: Why ideals in rings? Why normal subgroups in groups? Why filters
in Boolean algebras?, and many more. We do not feel like attempting any
answer to those questions. In another sense, question (a) suggests similar
questions: What are subalgebras in universal algebra good for? and many
more. Possibly, the whole enterprise called "universal algebra" is
there to answer such questions?
Having said that, it is clear that the most proper setting for a theory
of ideals is that of ideal determined classes (namely, when mapping a
congruence E to its $0$-class $\,0/E$ establishes a lattice isomorphism between
the congruence lattice and the ideal lattice). The first paper in this
direction [22] bore that in its title.
It comes out that -- for a variety V -- being ideal determined is the
conjunction of two independent features:
V has $\,\rm\color{#c00}{0\text{-regular}}\,$ congruences, namely for any congruences $\rm\,E,E'$
of any member of $V,$ from $\,\rm 0/E = 0/E'$ it follows $\rm\,E = E'$.
V has $\,\rm\color{#c00}{0\text{-permutable}}\,$ congruences, namely for any congruences $\,\rm E,E'$
of any member of $V,$ if $\,\rm 0 \ E\ y \ E'\, x,\,$ then for some $\rm z,\ 0\ E'\, z\ E\ x.$
Your operation $g$ is irrelevant to compute the congruences of $A \times A$ because it's one of the projections of $+$.
So the congruence lattice of $A \times A$ is the same as the one of the group $\mathbb Z_2 \times \mathbb Z_2$, which is the lattice $M_3$.
Here, having the linked diagram as reference,
\begin{align}
0 &= \{((a,b),(a,b)):a,b\in A\},\\
1 &= \{((a,b),(c,d)): a, b, c,d \in A\},\\
x &= \{((a,b),(a,b')): a,b,b' \in A\},\\
y &= \{((a,b),(a',b)): a,a',b \in A\},\\
z &= \{((a,a),(b,b)): a,b \in A\}.
\end{align}
The $0$ and $1$ congruences hold for all algebras: in the $0$, each element is related with itself and no other; in the $1$, every element is related with every other one.
In all algebras of the type $A \times A$, where $A$ is an algebra, we always get the congruences which are kernels of the projections, that is, we relate elements which have a common coordinate.
In this case, these are $x$ (where the first coordinate is fixed) and $y$ (where the second coordinate is fixed).
The last case, $z$, is still a congruence relation here, but it's not for all algebras $A$.
To see that these are precisely the congruence relations of $A \times A$, given that it is equivalent to a group, it is enough to see that that lattice is isomorphic to the subgroup lattice of $\mathbb Z_2 \times \mathbb Z_2$ (notice that, since $\mathbb Z_2$ is Abelian, so is $\mathbb Z_2 \times \mathbb Z_2$, whence all of its subgroups are normal).
Indeed, $x$ corresponds to the subgroup generated by $(0,1)$; $y$ to the subgroup generated by $(1,0)$ and $z$ to the subgroup generated by $(1,1)$.
Best Answer
I think you're right and you've found a confusion in the book.
The usual definition of a congruence on a relational structure would not have the condition (RP*) that you quoted but rather (RP#): If $a_1\equiv b_1,\dots,a_n\equiv b_n$ and $R_i(a_1,\dots,a_n)$ then $R_1(b_1,\dots,b_n)$. (Here $n$ is the number of argument places of $R_i$.) This (RP#) would indeed have the claimed, undesirable consequence if equality were one of the relations $R_i$. Indeed, using (RP#) with equality as $R_i$, we'd be able to infer from $x\equiv y$ (taking $a_1,b_1,a_2$ all to be $x$ and taking $b_2$ to be $y$) that $x=y$. So the equivalence relation $\equiv$ could only be equality.
The book's unusual requirement (RP*) seems to be designed specifically for the situation where each $R_i$ (now having $n+1$ argument places) is intended to represent an $n$-place function. As far as I can see, it does not cause any problem when the equality relation is among the relations $R_i$.
Also, "intended to represent an $n$-place function" might explain the use of the word "algebra". It looks to me as if the authors were sometimes thinking of algebras and sometimes of relational structures, and the two topics got mixed together confusingly.