In class, we defined a morphism $\phi: \mathcal{F} \rightarrow \mathcal{G}$ of presheaves to be injective if the map $\phi(U): \mathcal{F}(U) \rightarrow \mathcal{G}(U)$ is injective for every open $U $ in the topological space $X$.
Now there is an exercise, which goes as:
Problem: Let $\phi: \mathcal{F} \rightarrow \mathcal{G}$ be a morphism of presheaves of sets on the topological space $X$. Show that $\phi$ is a monomorphism in the category of presheaves of sets on $X$ iff $\phi$ is injective as a morphism of presheaves.
I am a little bit confused of what this means. I know what a monomorphism means in a category $\mathcal{C}$. We call an arrow $f: A \rightarrow B$ between objects in the category $\mathcal{C}$ a monomorphism, if for any two arrows $g_1, g_2: C \rightarrow A$ with $f \circ g_1 = f \circ g_2$ it follows that $g_1 = g_2$.
My confusion is: what does the statement "$\phi$ is a monomorphism in the category of presheaves of sets on $X$" mean? Are the presheaves $\mathcal{F}$ and $\mathcal{G}$ considered as the objects here? So does $\phi$ play the role of $f$ in the definition of monomorphism given earlier?
If that is the case, I have no idea how to prove this. I assume we have a monomorphism. Let $U \subset X$ be open. I wish to show that $\phi(U) : \mathcal{F}(U) \rightarrow \mathcal{G} (U)$ is injective. So given sections $s_1, s_2 \in \mathcal{F}(U)$ with $\phi(U)(s_1) = \phi(U)(s_2)$, I wish to prove that $s_1 = s_2$. How can this be done?
Fix some (small) category $\mathcal{C}$, then the category of presheaves on $\mathcal{C}$ is defined as follows:
Common notations for the category of presheaves are $\hat{\mathcal{C}}$, $\mathbf{Set}^{\mathcal{C}^\text{op}}$ and $[\mathcal{C}^\text{op}, \mathbf{Set}]$.
So yes, $\phi$ plays the role of $f$ in the definition you talk about.
Let's now have a look how to prove the actual question. Throughout we let $\phi: F \to G$ be a morphism of presheaves (i.e. a natural transformation). I will put part of the answers in spoilers (hover your mouse to see them), so that you can try to finish them yourself. Also, after you have understood the first direction, try the converse yourself first.
$\phi$ injective $\implies$ $\phi$ mono. Let $\alpha, \beta: H \to F$ be morphisms of presheaves, such that $\phi \alpha = \phi \beta$. We have to prove $\alpha = \beta$. Let $U$ be any object in $\mathcal{C}$, and let $x \in H(U)$, we have to prove $\alpha(U)(x) = \beta(U)(x)$ (why is this enough?).
$\phi$ mono $\implies$ $\phi$ injective. Let $\phi: F \to G$ be a monomorphism in the category of presheaves. Let $U$ be in $\mathcal{C}$, we have to prove that $\phi(U): F(U) \to G(U)$ is injective. So let $x, y \in F(U)$ such that $\phi(U)(x) = \phi(U)(y)$, we need to prove $x = y$. We define a presheaf $H$ as follows, for $V$ in $\mathcal{C}$: $$ H(V) = \operatorname{Hom}_{\mathcal{C}}(V, U) $$ where for $f: V \to V'$ the map $H(g)$ takes $g: V' \to U$ to $fg: V \to U$. Check that this indeed defines a presheaf. Now let $\alpha: H \to F$ be defined by $\alpha(V)(f) = F(f)(x)$, and check that this indeed defines a natural transformation of presheaves. Similarly, let $\beta: H \to F$ be defined by $\beta(V)(f) = F(f)(y)$.
This argument is essentially writing out a use of Yoneda's lemma, as Yining Chen wrote in their answer, where they also pointed out that a previous version of this answer contained a mistake.