How are the values of a function expressed in the formal language of ZFC set theory? I'm curious as to how the values $f(x)$ of a function $f$, which as defined, are the corresponding unique $y$ such that $(x,y)\in f$, are expressed formally in the language of ZFC (or an extension thereof). For example, with the help of the extension by definitions scheme, one can construct conservative extensions of ZFC with additional function symbols such as the power set operation, union, ordered pairs and Cartesian products with their respective definitional axioms. In particular, after proving $$\forall x\exists !y\forall z(\forall w(w\in z\rightarrow w\in x)\leftrightarrow z\in y)$$ in ZFC, we can add a new function symbol $\mathcal P$ to the signature and an additional axiom $$\forall x\forall z(\forall w(w\in z\rightarrow w\in x)\leftrightarrow z\in\mathcal P(x))$$ characterizing the power set of $x$. In this case, we can work out the value of $\mathcal P(x)$ to be the unique $y$ that satisfies the former sentence.
Likewise, we can add predicate symbols to the signature; for instance, the formula "$f$ is a function" is equivalent to $$\forall x(x\in f\rightarrow\exists y\exists z(x=(y,z)))\land\forall x\forall y\forall z(((x,y)\in f\land (x,z)\in f)\rightarrow y=z)$$ assuming we have extended the theory to capture the notion of ordered pairs. Moreover, we can add a ternary predicate so that the formula $f:X\to Y$ has its intended meaning in our supertheory, in a similar fashion.
The problem however occurs where we define the term $f(x)$ as the unique $y$ such that $(x,y)\in f$. How is this done formally? Do we add a new function symbol $f$ as a means to extend our supertheory so that $f(x)$ becomes a term? That can't be the case since $f$ would otherwise be undefined for most of the domain of discourse contrary to the behavior of function symbols in the signature such as $\mathcal P$.
Sure, the notation for $f(x)=y$ can be dismissed as an abbreviation for $(x,y)\in f$, but there are formulas that treat the notation differently where $f(x)$ is treated as a legitimate term, such as the formal statement of AC: $$\forall X(X\ne\emptyset\rightarrow\exists f(f:X\to\bigcup X\land\forall A(A\in X\rightarrow f(A)\in A)))$$ which just can't be a well-formed formula unless $f$ is a function symbol. My thoughts are that in this example, $f(A)\in A$ could very well be just an abbreviation for $\forall z((A,z)\in f\rightarrow z\in A)$. Does this suffice for everytime $f(x)$ is treated as a legitimate term?
 A: Let me address the "formal statement of the Axiom of Choice" part.
There are levels of formality, which we as humans distinguish between. Most of these are not really formal, because we are not specifying the language, the underlying logic, etc.
Most of these "formal statements" are full of shorthand abuse of notations. The main point, however, is that we know how to translate these statements, often by some elaborate step-by-step mechanism, to the true language.
For this reason, many set theory books will formulate the Axiom of Choice as "every family of non-empty sets has a selector", which does not involve functions. And it only involves shorthands for things like $\cap$ or $|x|=1$.
After you've developed the formalisation of functions in set theory (so a function is a set of ordered pairs with the functional property, i.e. for every $x$ in the domain there is a unique ordered pair with $x$ in the left coordinate), then we say that if $f$ is a function, we write $f(x)$ to denote the unique $y$ such that $(x,y)\in f$, as you suggest, and then we can start incorporating functions into our formulas as well and write "the formal statement" for "every family of non-empty sets admits a choice function". (And note that we had to also incorporate the notation of $(x,y)$ here, because that too is not part of the language of set theory.)
On the other hand, if you want to be "fully formal", and include $f$ in the language, then $f(x)$ is simply a term, and there is no need to define it or express it in any simpler way. Simply extend the language by including $f$ and the statement that $f$ is a function, and its restriction to the constant that you already added to denote the domain of $f$ is behaving as you wanted it to. Or at least, in the case of the axiom of choice, that it is a choice function on that domain.
A: This depends on the particular FOL implementation but to my knowledge $f(A)$ in that formal statement of AC is not a legitimate term. Function application is reserved to the those functions in the language, while $f$ there is being used as a variable (as evidenced by having an $\exists$ before it). The "right" thing would be to say  $\forall X(X\ne\emptyset\rightarrow\exists f(f:X\to\bigcup X\land\forall A(A\in X\rightarrow \forall z((A,z)\in f\rightarrow z\in A))))$, few places care enough to write down the whole formalism. Books like Kunen's Set theory write AC in a different way. Hence, what you suggested is fine.
However, I don't think it's a good idea to "abuse" extension by definitions and adding axioms to make sure it is right. You would be making your axioms unnecessarily big, in your specific case you would need a proper class of symbols, one for each function, and a proper class for axioms, one for each symbol, which as far as I can tell is fine but as I said it is not neccessary.
