In Category Theory, a epic or epimorphisms is any morphism such that whenever the following commutes:

\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[d, "f"] \arrow[r, "f"] & B \arrow[d, "g_1"] \\
B \arrow[r, "g_2"] & C
\end{tikzcd}
\end{document}

Then .

Remarks

In Set, epimorphisms are simply just the surjective functions.