In Tao's Analysis vol 1 we have various proofs from properties and operations on natural numbers, as well as axioms.
For example additive identity $a+0=a$.
But then in some proofs we apply these changes when the arguments are inside function calls. For example if $a+0=a$ then $S(a+0)=S(a)$.
What let's us do this? Maybe it's just so obvious it needs no further proof but what lets us say $F(a) = F(b)$ if $a=b$?
Firstly, you should ask yourself, what does "a=b" mean?
Generally, one would think that two objects, a and b, are equal, right? However, in mathematics one takes equality in the strongest sense, meaning that every object can only be equal to itself
Thus a=b means not that you have TWO objects equal to each other (because every object is taken to be equal only to itself and having two objects assumes that they are still distinct in some sort because you have two of them, not one, maybe in a sense of how they are located in space or something) but rather this means that you have two distinct NAMES (a and b) for the very same object!
Also from here it follows that if you have a=b you have some object with two names then obviously what is true of that object using its one name, would still remain true using its other name, that's why we can conclude f(a)=f(b) if we have a=b for every function like x+y for example or every property like "is divisible"
If you are still not satisfied you should know then that it is taken as an underlying axiom in logic that from having "a=b" you can substitute in every formula "a" and "b" instead of each other thus you can justify your reasoning by applying this axiom (it's called the substitution axiom)