TITLE: Line bundles on fibrations
QUESTION [6 upvotes]: 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$?

REPLY [11 votes]: 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$.

REPLY [7 votes]: No. 
Take $X=Spec(k[x^2,x^3])$, the cusp over the field $k$ , the trivial bundle $Y=X\times_k\mathbb A^1_k $ and the first projection $f=pr_X:Y\to X$ .
Every line bundle$M$ on $Y$ is trivial on the fibers, since said fibers are affine lines over the field $k$. However not every line bundle $M$ on $Y$ can be written  $f^*L$ with $L$ a line bundle on $X$.
Here is why:
A ring $R$ is called semi-normal if whenever elements $a,b \in R$ satisfy $a^3=b^2$, you can conclude that there exists $r\in R$ with $a=r^2, b=r^3$ . The ring is then automatically reduced (Costa). This notion is due to Traverso and Swan.
[Strange condition, eh? For example,  a normal domain $R$ is semi-normal: take $r=b/a\in Frac(R)$, which by normality must be in $R$ since it satisfies the integrality equation $r^2-a=0$. ]           
A theorem of Swan then states that given a ring $R$, the map from $R$ to its polynomial ring $j:R\to R[T]$  induces a surjection $j^*:Pic(R)\to Pic(R[T])$ if and only if the reduced ring $R_{red}=R/Nil(R)$ is semi-normal. This proves the above claim about the cusp (and much more).
Bibliography:
a) Here is a nice, completely self-contained  survey by Lombardi and Quitté on semi-normal rings. Its bibliography will lead you to the original articles by Traverso and Swan.
b) And there is another very nice survey by Vitulli.

REPLY [6 votes]: No. Let $X$ be an elliptic curve, $p\colon Y=X\times\mathbf P^1\to X$ the projection, $g\colon X\to X$ multiplication by $2$, and $f=gp$. Take a line bundle $M$ of degree $1$ on $X$. Then, $p^*M$ is trivial on the fibres of $f$. Suppose $p^*M\cong f^*L$ for some line bundle $L$ on $X$. Since $p^*$ is injective on $\mathrm{Pic}$ (see Hartshorne, Ex. III, 12.5), we have $M\cong g^*L$, but the degree of $g^*L$ is even, contradiction.