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$?

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$. 


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$ . A ring $R$ is called seminormal 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. 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 seminormal. This proves the above claim about the cusp (and much more). Bibliography: 


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. 

