My question rises from exercise 1.18 in chapter 2 of Hartshorne. Given a continuous function $f:X \rightarrow Y$, one has to show there is a natural bijection between $\mathrm{Hom}_X(f^{-1}\mathcal{G},\mathcal{F})$ and $\mathrm{Hom}_Y(\mathcal{G},f_*\mathcal{F})$, where $\mathcal{G}$ is a sheaf over $Y$ and $\mathcal{F}$ a sheaf over $X$.
So far I have shown that we have natural maps $f^{-1}f_* \mathcal{F} \rightarrow \mathcal{F}$ and $G \rightarrow f_* f^{-1} G$. I am not completely sure what is meant about naturality. My guess is that given a diagram $\require{AMScd}$
\begin{CD} f^{-1}\mathcal{G}_1 @>{}>> \mathcal{F}_1\\ @VVV @VVV \\ f^{-1}\mathcal{G}_2 @>{}>> \mathcal{F}_2 \end{CD}
one should get a diagram
\begin{CD} \mathcal{G}_1 @>{}>> f_*\mathcal{F}_1\\ @VVV @VVV \\ \mathcal{G}_2 @>{}>> f_*\mathcal{F}_2 \end{CD}
and analogously interchanging the roles of $f^{-1}$ and $f_*$. A first question is "am I right?". If so, now applying $f_*$ to the first diagram and using the natural maps mentioned above, I would have a diagram
\begin{CD} \mathcal{G}_1 @>{}>> f_* f^{-1} \mathcal{G}_1 @>>> \ f_*\mathcal{F}_1\\ & @VVV @VVV \\ \mathcal{G}_2 @>{}>> f_* f^{-1} \mathcal{G}_2 @>>> f_*\mathcal{F}_2 \end{CD}
and I would have to build the first arrow. By simplicity, instead of the sheaves given by $f^{-1}$, I argue using the presheaves whose associated sheaf is the inverse image. Then given $U$ open in $Y$, I want a map $\mathcal{G}_1 (U) \rightarrow \mathcal{G}_2(U)$, given one between \begin{equation} \lim_{f(f^{-1}(U)) \subset V} \mathcal{G}_1(V) \rightarrow \lim_{f(f^{-1}(U)) \subset V} \mathcal{G}_2(V) \end{equation}
Now, in general a map between direct limits does not come from a map between the direct systems, right? Hence I was wondering how to build the map I want. In know that $U$ is in the set where I do the direct limit, and then my guess was:
given a section in $\mathcal{G}_1(U)$, I send it to its class $\overline{s}$ in the direct limit. Then, for this precise section (not for the whole homomorphism), the map between the direct limits is given by assigning a section $t \in \mathcal{G}_2(V)$, with $f(f^{-1}(U))\subset V \subset U$.
Now my idea was: I cannot ask for $V$ to be $U$, but if I manage to do something like this around each point $P \in U$ (i.e. I take $s_{|U_P}$ with $P \in U_P \subset U$ with the property that if I do the procedure described for $U$, I find a $V_P$ with $P \in V_P$), then I can glue the sections each point give me, since they come from the map of direct limits restricted to smaller sets.
Now I have two doubts: I know that the sections I pick for points $P$ and $Q$ agree eventually in come intersection, since both have to describe the image of $\overline{s}_{|V_p \cap V_Q}$, but I don't know anything about $V_P \cap V_Q$. Also, I am not sure that for any point $P$ I can pick the $V_P$ I want.
Are my ideas in teh right direction or am I completely lost? Also, am I in trouble defining the images I want since I am not usinge the sheaves $f^{-1}\mathcal{G}_i$ but the presheaves defining them?
You should look at Iversen's "Cohomology of Sheaves" here, from page 96, and especially page 98, where it is shown that the direct image functor is left adjoint to the inverse image functor, which is exactly what you want.