Let $f:Y \to X$ be a flat morphism with positive dimensional fibers. Is it always true that line bundles that are trivial along each fiber are of type $f^\*L$ for $L$ a line bundle on $X$?



Line bundles on fibrations
It is true with some extra assumptions. If $f$ is projective (EDIT: in fact proper is enough) and has connected and (EDIT) reduced fibers and $M$ is a line bundle that is trivial on every fiber, then $h^0(X\_y, M)=1$ for every $y\in Y$. If $Y$ is integral, then it follows that $L:=f\_\*M$ is a line bundle and the natural map $f^\*L\to M$ is an isomorphism.


EDIT: the argument works provided $h^0(X\_y, {\mathcal O})=1$ for every $y$. So in some cases one can remove the assumption that all the fibers are reduced. For instance if $X$ is a smooth complex surface and $Y$ is a smooth curve, then by Zariski's lemma every fiber $X\_y$ is either $1$-connected or $X\_y=mD$, where $D$ a $1$-connected divisor and $D|\_D$ is torsion of order $m$. Using the fact that $h^0({\mathcal O}\_D)=1$ if $D$ is $1$-connected and applying induction, one gets $h^0(X\_y, {\mathcal O})=1$ for every $y$. 


