The following is a theorem taken from Introduction to Topological Manifolds by John Lee
I'm just trying to fill in the arguments that show that $\tilde {f}$ is unique and well defined.
Firstly to show that $\tilde{f}$ is well defined, define $\tilde{f} : Y \to Z$ by $\tilde{f}(y) = f(x)$. Pick $y \in Y$, we have $y = q(x)$ for some $x \in X$ (since $q$ is surjective), hence $\tilde{f}(q(x)) = f(x)$, and since $f$ is a well-defined function from $X \to Z$, for every $y \in Y$, $\tilde{f}(y) = z$ for some $z = f(x) \in Z$. It is clear that $\tilde{f}$ must be well defined (otherwise it would contradict the fact that $f$ is well defined)
But I'm having some trouble completing the proof to show $\tilde{f}$ is unique. How could I show $\tilde{f}$ is unique? Usually one assumes there exists another well-defined map $\tilde{f'} : Y \to Z$, for which $\tilde{f'}(y) = f(x)$ but by construction we trivially end up with $\tilde{f'}(y) = \tilde{f}$. Is this the missing argument the author would have intended?

It seems that you don't understand the meaning of “well-defined”. It means that, for each $y\in Y$, there is one and only one $z\in Z$ such that $\tilde f(y)=z$. In order to prove that, pick $y\in Y$. Then $y=q(x)$, for some $x\in X$ and you define $\tilde f(y)$ as $f(x)\in Z$. What happens if $q(x)=q(x')$ for some $x'\in X$? Then $f(x)=f(x')$, by hypothesis (which you did not use). Therefore, $\tilde f(y)$ does not depend upon the choice of $x$. So $\tilde f(y)$ is unique and it belongs to $Z$.
Now, let $f^\star\colon Y\longrightarrow Z$ be such that $f^\star\circ q=f$. You want to prove that $f^\star=\tilde f$. Pick $y\in Y$. Then $y=q(x)$, for some $x\in X$ and so$$f^\star(y)=f^\star\bigl(q(x)\bigr)=f(x)=\tilde f(y).$$Therefore, $f^\star=\tilde f$.