In which cases does pullback commute with the Hom-sheaf?
Solution 1:
$\def\H{{\mathcal Hom}}\def\HH{{\operatorname{Hom}}}$Everything you wrote seems correct for the locally free case. Though its easy to overlook subtle things with these type of arguments, it looks good to me.
For the second I believe there is a natural map $f^*\H_Y(E,F) \to \H_X(f^*E,f^*F)$. I will actually define a map $\H_Y(E,F) \to f_*\H_X(f^*E, f^*F)$ and use the adjunction with $f^*$ to get the required map.
Let $U \subseteq Y$ be open. Then $\H_Y(E,F)(U) = \HH(E|_U,F|_U)$ and $f_*\H_X(f^*E,F^*F)(U) = \HH(f^*E|_{f^{-1}(U)}, f^*F|_{f^{-1}(U)})$. Then we note that
$$ f^*E|_{f^{-1}(U)} = f|_{f^{-1}(U)}^*\left(E|_{f^{-1}(U)}\right) $$
and $f^*|_{f^{-1}(U)}$ is a functor from sheaves of $\mathcal{O}_U$ modules to $\mathcal{O}_{f^{-1}(U)}$ modules. Thus we get a natural map of sheaves of modules from $U$ from functoriality:
$$ \HH(E|_U, F|_U) \to \HH\left(f|_{f^{-1}(U)}^*\left(E|_{f^{-1}(U)}\right), f|_{f^{-1}(U)}^*\left(F|_{f^{-1}(U)}\right)\right) = \HH(f^*E|_{f^{-1}(U)}, f^*F|_{f^{-1}(U)}). $$
Everything is suitably natural enough that it should commute with the restriction maps for inclusions $V \subset U$ giving a map of sheaves $\H_Y(E,F) \to f_*\H_X(f^*E, f^*F)$.
Now that we have the required map $f^*\H_Y(E,F) \to \H_X(f^*E,f^*F)$, I think we need $X$ and $Y$ to be schemes not just locally ringed spaces. Then we can reduce to checking that this is an isomorphism on affine covers in which case it reduces to the isomorphism from commutative algebra. Without having $X$ and $Y$ be schemes I don't think we can make the argument work because $\H$ does not commute with taking stalks so we can't just check it on local rings.
EDIT: See comments below, apparently the argument does work on any ringed space as long as $E$ is of finite presentation.