TITLE: Universal property of sheafification
QUESTION [8 upvotes]: Given a presheaf $\mathcal{F}$ there is a sheaf $\mathcal{F}^+$ and a morphism $\theta: \mathcal{F}\to\mathcal{F}^+$ with the property that for any sheaf $\mathcal{G}$ and any morphism $\varphi: \mathcal{F}\to \mathcal{G}$ there is a unique morphism $\overline{\varphi}:\mathcal{F}^+\to\mathcal{G}$ such that $\varphi=\overline{\varphi}\circ \theta$.
If $U$ is open I know how to construct $\mathcal{F}^+(U)$ as a set of functions $$f:U\to\bigcup_{p\in U}\mathcal{F}_p$$
such that $f(p)\in\mathcal{F}_p$ and for every $p\in U$ there is an open set $p\in V_p\subset U$ and $g\in \mathcal{F}(V_p)$ such that for all $q\in V_p$ the germ $g_q=f(q)$.
But I don't know how to construct the $\overline{\varphi}$ map.

REPLY [5 votes]: uniqueness of $\overline{\varphi}$ 
Let $\psi\colon \mathcal{F}^{+}\to \mathcal{G}$ also satisfy $\psi\circ\theta=\varphi$.
Take stalk at for any $x\in X$;
\begin{align}
\overline{\varphi}_x\circ\theta_x=\varphi_x,\psi_x\circ\theta_x=\varphi_x.
\end{align}
Since $\theta_x$ is isomorphic, 
\begin{align}
\overline{\varphi}_x=\varphi_x\circ\theta_x^{-1}=\psi_x.
\end{align}
Therefore $\overline{\varphi}=\psi$.
existence of $\overline{\varphi}$
Take $s\in \mathcal{F}^+(U)$.By definition of $\mathcal{F}^+(U)$, for every $x\in U$ there exists an open neighborhood $x\in V_x\subset U$ and $t^x\in \mathcal{F}(V_x)$ such that $s(y)=(t^x)_y$ for all $y\in V_x$.
Then $\{V_x\}_{x\in U}$ is open covering of $U$ and $(\varphi(V_x)(t^x))_{x\in U}\in \prod_{x\in U}\mathcal{G}(V_x)$ satisfies gluing property.
In fact, for any $x,x'\in U$, first we get $t^x|_{V_x\cap V_{x'}}=t^{x'}|_{V_x\cap V_{x'}}$.
(because for arbitrary $y\in V_x\cap V_{x'}$, 
\begin{align}
(t^x|_{V_x\cap V_{x'}})_y=(t^x)_y=s(y)=(t^{x'})_y=(t^{x'}|_{V_x\cap V_{x'}})_y)
\end{align}
So, 
\begin{align}
    \varphi(V_x)(t^x)|_{V_x\cap V_{x'}}
    =\varphi(V_x\cap V_{x'})(t^x|_{V_x\cap V_{x'}})
    =\varphi(V_x\cap V_{x'})(t^{x'}|_{V_x\cap V_{x'}})
    =\varphi(V_{x'})(t^{x'})|_{V_x\cap V_{x'}}.
\end{align}
Therefore there uniquely exist $g\in \mathcal{G}(U)$ such that $g|_{V_x}=\varphi(V_x)(t^x)$ for all $x\in U$ since $\mathcal{G}$ is sheaf.Then we set $\overline{\varphi}(U)(s)\colon=g$.
What we have to do first is to check this $\overline{\varphi}$ is surely morphism of sheaf.
Let $V\subset U$ be open sets,then it is enough to show $\overline{\varphi}(U)(s)|_V=g|_V=\overline{\varphi}(V)(s|_V)$ under $\overline{\varphi}(U)(s)=g$.
First we can choose $V_x$ for $V'_x\colon=V_x\cap V$, $t^x$ for ${t'}^x \colon=t^x|_{V'_x}$ when we set $U=V,s=s|_V$.
(because for any $y\in V'_x$, \begin{align}
    s|_V(y)=s(y)=(t^x)_y=(t^x|_{V'_x})_y=({t'}^x)_y)
\end{align}
Then
\begin{align}
    (g|_V)|_{V'_x}=g|_{V'_x}=(g|_{V_x})|_{V'_x}=(\varphi_{V_x}(t^x))|_{V'_x}=\varphi_{V'_x}(t^x)|_{V'_x}=\varphi_{V'_x}({t'}^x).
\end{align}
So $\overline{\varphi}(V)(s|_V)=g|_V$.This implies $\overline{\varphi}$ is morphism of sheaf.
Now only $\overline{\varphi}\circ\theta=\varphi$ is left to show.
Let $u\in \mathcal{F}(U)$.
When we set $U=U,s=\theta(U)(u)$, we can choose $V_x=U,t^x=u$ since for any $y\in U$, $s(y)=u_y$(by definition of $\theta$).
So, $\overline{\varphi}(U)(s)=\varphi(U)(u)$, that is, 
\begin{align}
\varphi(U)(u)=\overline{\varphi}(U)(s)=\overline{\varphi}(U)(\theta(U)(u)).
\end{align}