I'm trying to prove that $f^\flat$ is well-defined, where $f^\flat:Z\times A \to X$ is defined to be the composition $e_X \circ 1\times f$ where $1\times f: A\times Z \to A\times X^A$ and $e_X: A\times X^A \to X$ but I'm not sure how to prove equality of sets (well I suppose $1$ being a terminal object induces a unique map $\beta_S$ for every set $S$, so that two sets, $S$ and $T$, are equal if $\beta_S=\beta_T$ but I'm not sure that's helpful).
Notice in particular, if $X^A = Y^B$ but $X\neq Y \vee A\neq B$ then $f^\flat$ is not well-defined.
As far as I understand, this statement is false. Category theory usually has a hard time dealing with equality since categorical constructions are typically done up to isomorphism (in this specific instance, the exponential object $X^A$ is formally defined as the universal set endowed with an evaluation map $X^A\times A\to X$ and is thus only unique up to unique isomorphism).
In this case, it is possible for $X^A=Y^B$ without $X=Y$ or $A=B$ (it can even be neither): if $X=Y=*$ is the terminal object, then $X^A=Y^B$ for any $A$ and $B$; conversely, if $A=B=\varnothing$ is the initial object, then $X^A=Y^B$ for any $X$ and $Y$. Combining the two, you can have $X^A=Y^B$ with $X\neq Y$ and $A\neq B$ (for instance, $\{0,1\}^\varnothing=\{0\}^{\{0\}}$ are both singletons).
Even if you pick your favourite canonical set $X^A$ (for instance, taking $X^A := \{f\subseteq A\times X \mid \forall a\in A,\exists!x\in X,(a,x)\in f\}$) the statement will still be false just by taking $A=B=\varnothing$ since $X^A=Y^B=\{\varnothing\}$ for any $X,Y$.