Suppose we have some equality-candidate relation $"="$ and we want to check if it satisfies the axiom of substitution and we have some $n-variable$ function for that. Now do we have to check that
if $a=b$, then $f(x_1,x_2,...,a,...,x_n)=f(x_1,x_2,...,b,...,x_n)$ for every position from $1$ to $n$? For example if we have a relation-candidate $"="$ and we have defined what sum of integers $"+"$ means and regard it as two variable function, then do we need to prove that if $a=b$ then $+(a,c)=+(b,c)$ and $+(c,a)=+(c,b)$? What do we do in case of predicates-formulas?
Second question relates to lemma in Tao's Analysis section about constructing integers. So, what he does there is that he defines integers as ordered pairs $(a, b) ∈ N × N$ and places an equivalence relation $=$ on these pairs by declaring $(a, b) = (c, d)$ iff $a+d = c+b$. (Well, he uses a notation $(a,b)= a - b$ where sign $"-"$ doesn't mean anything. After checking that relation is indeed of equivalence he defines operations of sum and multiply on integers.
And proves lemma 4.1.3. that those operations are well-defined.
Lemma 4.1.3 (Addition and multiplication are well-defined). Let $a, b, a_0, b_0, c, d$ be natural numbers. If $(a - b) = (a_0−b_0)$, then $(a−b) + (c−d) = (a_0−b_0) +(c−d)$ and $(a−b) × (c−d) = (a_0−b_0)×(c−d)$, and also $(c−d)+(a−b) = (c−d)+(a_0−b_0)$ and $(c−d) × (a−b) = (c−d) × (a_0−b_0)$. Thus addition and multiplication are well-defined operations (equal inputs give equal outputs).
So, second question is what the point of that lemma(what "well-defined operations" means). If i understand correctly he just checks if our relation $"="$ for integers is suitable to be a relation of equality, showing in lemma that it satisfies the axiom of substitution for these operations.
Let me start by saying that I am not familiar with Tao's presentation. But this is a well-known construction dating back to the 19th century, so any variances between what Tao does and what I describe are almost certainly philosophic instead of in substance.
We are trying to build integers from the natural numbers $\Bbb N$. So we introduce the relation $\sim$ on $\Bbb N^2$ by $(a, b) \sim (c,d)$ if and only if $a+d = b + c$, and prove that it is an equivalence relation (reflexive, symmetric, transitive). For any $(a,b) \in \Bbb N$, we define its equivalence class to be the set $[(a,b)] := \{(c,d) \in \Bbb N^2\mid (c,d) \sim (a,b)\}$, and note that $(a,b) \sim (c,d)$ if and only if $[(a,b)] = [(c,d)]$.
Then we define $\Bbb Z$ to be the set of equivalence classes. So what exactly are the elements of $\Bbb Z$? They are sets of ordered pairs of natural numbers. There is no addition or multiplication yet defined on these sets.
You offered definitions of addition and multiplication, but unless Tao is doing something unusual (but not entirely unheard of), your definitions are not exactly right. The definitions you gave were between pairs of natural numbers. But the elements of $\Bbb Z$ are not pairs. They are sets of pairs. The actual definitions are:
Now there is an issue with these definitions: we want $x + y$ and $x \times y$ to each be a single element of $\Bbb Z$, but the definitions depend on arbitrarily chosen representatives $(a,b)$ of $x$ and $(c,d)$ of $y$. If instead we chose a different representative $(a', b') \in x$, would we get the same element of $\Bbb Z$ to be $x + y$? And similarly for $y$ and $x \times y$?
This is what Tao means by being well-defined. For this definition of $x + y$ to work, we need that for any $(a, b), (a', b') \in x$ and any $(c, d), (c', d') \in y$, that $[(a + b, c + d)] = [(a' + b', c' + d')]$. Otherwise there will be more than one element of $\Bbb Z$ that meets the definition. As already noted, $[(e,f)] = [(g. h)]$ if and only if $(e,f) \sim (g,h)$ (this is a general property of equivalence relations and their equivalence classes). So we can translate the condition for $x + y$ to be well-defined to the statement:
If $(a, b) \sim (a',b')$ and $(c,d) \sim (c', d')$, then $(a + c, b + d) \sim (a' + c', b' + d')$.
So that is what Tao proves to show that the definition of $x + y$ makes sense - that it really does define exactly one element of $\Bbb Z$ to be the sum of $x$ and $y$.
And similarly for $x \times y$.