Do we have $(gf)^*\mathcal F=f^*(g^*\mathcal F)$? Let $X\xrightarrow f Y\xrightarrow g Z$ be morphisms of schemes and $\mathcal F$ an $\mathcal O_Z$-module. Do we have $(gf)^*\mathcal F=f^*(g^*\mathcal F)$?
Yes since for a morphism of schemes $h:X \rightarrow Y$, $h^*$ is the left adjoint to $h_*$. 

Thus we have 

$$Hom((f \circ g)^* \mathscr F, \mathscr G) = Hom(\mathscr F, (f \circ g)_* \mathscr G) = Hom(\mathscr F, (f_* \circ g_*) \mathscr G) = Hom(f^*\mathscr F, g_* \mathscr G) = 
 Hom((g^* \circ f^*)\mathscr F, \mathscr G)$$ for all $\mathscr F$ and $\mathscr G$ modules on the respective schemes.

And thus by yoneda lemma $(f \circ g)^* \mathscr F = (g^* \circ f^*)\mathscr F$
$(gf)^*\mathcal F=f^*(g^*\mathcal F)$

I can find it in Vakil's book.