An isomorphism is a mono and epi This must be very easy, but how to prove that an isomorphism is an epi and also a mono?

Suppose $f:X\to Y$ is an isomorphism. This means there is an arrow $g:Y\to X$ such that $fg=1_Y,\ gf=1_X$.

To show $f$ is an epi, suppose $h,h':Y\to Z$ are arrows and $hf=h'f$. We must show that $h=h'$. There must be some kind of trick with composing something with identities, but I don't know what the trick is. For example, we can write $hf=h1_Yf=hfgf$ or something like that, but I don't see how this can be helpful.

And similarly, I don't see what to use to prove that $f$ is an mono. To this end we need to show that if $h,h':Z\to X$ are arrows, then $fh=fh'\implies h=h'$.
To show that it is epi, simply precompose with $g$. I.e.,
$$hf=h'f \qquad \Rightarrow \qquad hfg=h'fg \qquad \Rightarrow \qquad h=h'$$
since $fg=1$. Similarly, to show that it is mono, postcompose with $g$
$$fh=fh' \qquad \Rightarrow \qquad gfh=gfh' \qquad \Rightarrow \qquad h=h'$$
since $gf=1$.
We will shot that $f$ is mono.

Lets suppose that there are $a,b\in X$ such that $f(a)=f(b)$. Then, we will apply $g$:

$$g(f(a))=g(f(b))~\Rightarrow~ 1_X(a) = 1_X(b) ~ \Rightarrow~a=b.$$

We will shot now that $f$ is epi:

Let be $c\in Y$, since $c=c$, we may write $1_Y(c)=c$.
but: $$1_Y(c)=f(g(c))~\Rightarrow~ \exists d\in X ~ (d=g(c)),~ \mbox{ s.t } f(d)=c $$

which means that $f$ is also epi.