[guided]We need to turn syntactic equality of types into an actual map. The intended map fixes the parameter set $A$ and sends each coordinate $a_i$ to the corresponding coordinate $b_i$. Define
\begin{align*}
D := A \cup \{a_1,\dots,a_n\}.
\end{align*}
Then set $f(c):=c$ for $c \in A$ and $f(a_i):=b_i$ for $1 \leq i \leq n$.
There are two possible well-definedness issues. First, two coordinates of $a$ might be equal. If $a_i=a_j$, then $\mathfrak C \models x_i=x_j$ at $a$, so the formula $x_i=x_j$ lies in $\operatorname{tp}(a/A)$. Since the two types over $A$ are equal, this formula also lies in $\operatorname{tp}(b/A)$, and therefore $b_i=b_j$. Second, a coordinate of $a$ might already be a parameter from $A$. If $a_i=c$ for some $c \in A$, then the $L(A)$-formula $x_i=c$ lies in $\operatorname{tp}(a/A)$, hence lies in $\operatorname{tp}(b/A)$, so $b_i=c$. Thus the two defining rules for $f$ never conflict.
Now we verify that $f$ is partial elementary. Let $r \in \mathbb N$, let $d_1,\dots,d_r \in D$, and let $\psi(y_1,\dots,y_r)$ be any $L$-formula. Each $d_k$ is either a parameter from $A$ or one of the coordinates $a_i$. By replacing the parameters from $A$ by named parameters and replacing each occurrence of $a_i$ by the variable $x_i$, the assertion
\begin{align*}
\mathfrak C \models \psi(d_1,\dots,d_r)
\end{align*}
becomes the assertion that some $L(A)$-formula $\theta(x_1,\dots,x_n)$ holds of $a$. Since $\operatorname{tp}(a/A)=\operatorname{tp}(b/A)$, we have
\begin{align*}
\mathfrak C \models \theta(a_1,\dots,a_n)
\iff
\mathfrak C \models \theta(b_1,\dots,b_n).
\end{align*}
Translating this statement back through the definition of $f$ gives
\begin{align*}
\mathfrak C \models \psi(d_1,\dots,d_r)
\iff
\mathfrak C \models \psi(f(d_1),\dots,f(d_r)).
\end{align*}
Since this holds for every finite tuple from $D$ and every $L$-formula, the map $f:D \to f(D)$ is partial elementary.[/guided]