Suppose we're working in a topos. Let $f : a \rightarrow b$ be an arbitrary morphism, and $g : c \rightarrowtail a$ be monic. Let $fg* : c \twoheadrightarrow z$ and $f[g] : z \rightarrowtail b$ be the components of the epi-monic factorization of $f \circ g$. Is it true that the square formed by $f \circ g$ and $f[g] \circ fg*$ is a pullback?
It sure seems to be in $\mathbf{Set}$, but I'm not able to prove (or give a counterexample) in a general topos.
No. This isn’t even true in the category of sets. Let $a$ be a 2-element set and $b, c$ be one-element sets to see a counterexample.
In the category of sets, if we want this to be true for all subsets $c \subseteq a$, a necessary and sufficient condition is that $f$ is injective.