TITLE: Is there a proof that performing an operation on both sides of an equation preserves equality?
QUESTION [15 upvotes]: so I was learning some abstract algebra and group theory, when they went over the proof of the cancellation law
$$
ab = ac\implies a^{-1}(ab) = a^{-1}(ac)\implies (a^{-1}a)b = (a^{-1}a)c\implies eb=ec \implies b=c
$$
But the first step in which you add the additional term seems jarring to me, especially since I felt we were proving ever trivial thing from the ground up. Obviously I'm familiar with middle school pre-algebra, so I know that it is true that if we perform an operation on both sides it preserves equality, but I didn't know how we know this is the case always. Is it an axiom or is it proven?
Here is my attempt at a proof, let me know if I am going in the correct direction. 
Assume via axiom that $x=x$ and if $a=b$ and $b=c$ then $a=c$, and prove that $a=b\implies ka=kb$
We know that $a=b$, we define $x\mid x=a \implies a=x$. Since $a=b$ and $a=x$, then $b=x$ which we can rewrite as $x=x$. Now we perform the operation on both sides $kx=kx$, which is true via our axiom. Then we re-substitute $x=a$ and $x=b$ to get $ka=kb$. Q.E.D
That was my original idea but I don't know if that's watertight. Thank you!

REPLY [2 votes]: The preservation of equations when performing operations follows from the very definition of what operation is. That's all!
Namely, if $\,a=b,\,$ and $\,f\,$ is an operation which applies to the given arguments then $\,f(a)=f(b)\,$ or otherwise $\,f\,$ would not be an operation.
The above applies also to operations in several (or even infinitely many) variables because a collection of variables can be interpreted as a single variable. If you have, say, variables $\,a_1\ldots a_n\,$ then we introduce (explicitly or implicitly) a new variable $\,a:=(a_1\ldots a_n),\,$ and now this is the same story.
REMARK:   More generally, we can consider functions -- the preserving equations by functions is again due to the very definition of the notion of function, just as it was in the case of operations (operations map arguments into the same total set of arguments while function may have their ranges not related to the set of arguments).