When will the pushforward of a structure sheaf still be a structure sheaf? Let $f:X\rightarrow Y$ be a morphism of schemes.


*

*When $PicY\rightarrow PicX$ is an embedding and $f_{*}\mathscr{O}_{X}$ is invertible, it is the structure sheaf of $Y$.

*In the proof of Zariski's Main Theorem, we have: If $f$ is birational, finite, integral, and $Y$ is normal, then $f_{*}\mathscr{O}_{X}$ is the structure sheaf of $Y$.
My questions are
1) What exactly prevent $f_{*}\mathscr{O}_{X}$ to be a structure sheaf?
2) Is there any necessary and sufficient condition(s) guarantee that $f_{*}\mathscr{O}_{X}$ is a structure sheaf?
 A: Another issue that has not been addressed is what happens if $f$ is not proper. You may have intended to assume that it is, but it also an interesting question for not necessarily proper morphisms. For that matter, you could ask "if $f:X\hookrightarrow Y$ is an open embedding, when will $f_*\mathscr O_X$ be isomorphic to $\mathscr O_Y$?" You are also writing that "... if $f_*\mathscr O_X$ is a line bundle, then ...". It should be noted that this is actually a strong restriction. For instance if you have a generically finite morphism that satisfies this, then it has to be birational.
For the question of an open embedding the answer is relatively simple. If the complement of $X$ in $Y$ has a non-empty codimension $1$ part, then $f_*\mathscr O_X$ is not even coherent, so little chance there. If the complement is of codimension at least $2$, then this is a condition on the singularities of $Y\setminus X$, and essentially equivalent to $Y$ being $S_2$ along $X\setminus Y$. 
A: Q: Exactly what information is contained in $f_*\mathscr O_X$?  Look at the
definition.  For any $U\subseteq Y$ open, $f_*\mathscr O_X(U) = \mathscr O_X(f^{-1}(U))$ =
regular functions on $f^{-1}(U)$.  So the information in $f_*\mathscr O_X$ is related
to the sets in $X$ of form $f^{-1}(U)$.
Cases where $f_*\mathscr O_X$ contains as little information about $X$ as possible.
If $X$ is irreducible and projective and $f$ is constant, e.g. if $Y$ is affine, then
the only non empty set of form $f^{-1}(U)$ in $X$ is $X$ itself.  In this case
$f_*\mathscr O_X$ is a skyscraper sheaf with stalk $k$ supported on the image point
of $f$ in $Y$.  There is very little information here about $X$, but perhaps we do
see that $f$ is constant and that $X$ is connected.  More generally, if $Z$ is a
projective variety, $Y$ is any variety, and $X = Z\times Y$, and $f:Z\times Y\to Y$
is the projection, then $f^{-1}(U) = Z\times U$, so an element of $f_*\mathscr
O_X(U)$, i.e. a regular function on $f^{-1}(U)$, is determined by its restriction to
$\{p\}\times U$ for any $p\in X$, i.e., a regular function on $U$ in $Y$.  Thus in
this case we have $f_*\mathscr O_X = \mathscr O_Y$.  Consequently in this case
$f_*\mathscr O_X$ recovers $Y$, but contains no information at all about $X$.
In general, if $f:X\to Y$ is a projective morphism with every fiber connected, and
$Y$ is any normal variety, then $f_*\mathscr O_X = \mathscr O_Y$, so again
$f_*\mathscr O_X$ contains little information about $X$.  Recall that if $X$ is a
projective variety then every morphism out of $X$ is a projective morphism, and more
generally a projective morphism $X\to Y$ is one that factors via an isomorphism of X
with a closed subvariety of $\mathbb P^n\times Y$, followed by the projection
$\mathbb P^n\times Y\to Y$.  Suppose that $f:X\to Y$ is any projective morphism.
Then the fibers $f^{-1}(y)$ over points $y \in Y$ are all finite unions of projective
varieties.  Therefore for any open set $U\subseteq Y$ containing the point $y$, the
only regular functions in $\mathscr O_X(f^{-1}(U)) = f_*\mathscr O_X(U)$ are constant
on every connected component of the fiber $f^{-1}(y)$.  Thus $f_*\mathscr O_X$ can
contain little information about $X$ and $f$, other than at most the connected
components of the fibers.  We shall see below that it contains exactly this
information.
Cases where $f_*\mathscr O_X$ contains as much information about $X$ as possible.
If $f:X\to Y$ is a map of affine varieties, then the global sections of $f_*\mathscr
O_X$ determine $X$ completely, since then $H^0(Y,f_*\mathscr O_X) = H^0(X,\mathscr
O_X)$, and then $X = \mathrm{Spec}h^0(X,\mathscr O_X)$, is the unique affine variety
with coordinate ring $H^0(X,\mathscr O_X)$.  The generalization of this case is that
of any affine map $f:X\to Y$, since then $X$ can be recovered by patching together
the analogous construction from $H^0(U,f_*\mathscr O_X)$ for affine open sets
$U\subseteq Y$.  Thus $X$ is completely determined by $f_*\mathscr O_X$ for any
affine map $f:X\to Y$, and this is essentially the only case.  I.e. in general
$f_*\mathscr O_X$ is always a quasi coherent $\mathscr O_Y$ algebra, and if we want
it to determine a variety, as opposed to a "scheme", it is reasonable to assume for
all $U\subseteq Y$ affine open, that $f_*\mathscr O_X(U)$ is a finitely generated k
algebra, as well as an $\mathscr O_Y(U)$ algebra.  We may call temporarily such an
$\mathscr O_Y$ algebra "of finite type".  Thus if $f:X\to Y$ is any morphism such that
$f_*\mathscr O_X$ is of finite type, then the patching construction above yields not
necessarily $X$, but a variety $Z$ and an affine map $h:Z\to Y$ which factors via a
map $g:X\to Z$, where $f = h\circ g$, and where $g_*(\mathscr O_X) = \mathscr O_Z$.
In particular then, we have $f_*\mathscr O_X = (h\circ g)_*(\mathscr O_X) =
h_*(g_*(\mathscr O_X))= h_*(\mathscr O_Z)$.  So since $h$ is affine, $f_*\mathscr O_X =
h_*(\mathscr O_Z)$ determines not $X$, but $Z$.  (Kempf, section 6.5.)
The case of an arbitrary projective morphism.
Now when $f:X\to Y$ is any projective morphism, then $f_*\mathscr O_X$ is a coherent
$\mathscr O_Y$-module, hence we get a factorization of $f$ as $h\circ g:X\to Z\to Y$,
where $h:Z\to Y$ is affine, and where also $h_*(\mathscr O_Z) = f_*\mathscr O_X$.
Then $h$ is not only an affine map, but since $h_*(\mathscr O_Z)$ is a coherent $\mathscr
O_Y$-module, $h$ is also a finite map.  Moreover $g:X\to Z$ is also projective and since
$g_*(\mathscr O_X) = \mathscr O_Z$, it can be shown that the fibers of $g$ are connected.
Hence an arbitrary projective map $f$ factors through a projective map g with connected
fibers, followed by a finite map $h$.  Thus in this case, the algebra $f_*\mathscr O_X$
determines exactly the finite part $h:Z\to Y$ of $f$, whose points over $y$ are precisely
the connected components of the fiber $f^{-1}(y)$.
One corollary of this is "Zariski's connectedness theorem".  If $f:X\to Y$ is projective
and birational, and $Y$ is normal then $f_*\mathscr O_X= \mathscr O_Y$, and all fibers
of $f$ are connected, since in this case $Z = Y$ in the Stein factorization described
above.  If we assume in addition that $f$ is quasi finite, i.e. has finite fibers, then
$f$ is an isomorphism.  More generally, if $Y$ is normal and $f:X\to Y$ is any birational,
quasi - finite, morphism, then $f$ is an embedding onto an open subset of $Y$ ("Zariski's
'main theorem' ").  More generally still, any quasi finite morphism factors through
an open embedding and a finite morphism.
A: Let me try to write an informal explanation as to why (and why not) you might have $f_* \mathcal{O}_X = \mathcal{O}_Y$.  This is basically what J.C. Ottem wrote, but I'm trying to explain the reason at a slightly more philosophical level.
Now $O_X$ is the sheaf of regular functions on $X$.  Given an open set $U \subseteq Y$, the sections $\Gamma(U, f_* \mathcal{O}_X)$ is just $\Gamma(f^{-1}(U), \mathcal{O}_X)$.  For this to be viewed as even a subset of functions on $U$, you would expect it to be constant / well-defined at the points of $U$.  So consider some (closed) point $z \in U$.  Therefore, you need a section $\sigma \in \Gamma(f^{-1}(U), \mathcal{O}_X)$ to be constant on the fiber $f^{-1}(z)$.  Since $f$ is proper, this fiber is also proper, and thus the only sections are constant.  I just lied of course, the only sections are the functions that are constant on each connected component of the fiber.
Thus if you have fibers with multiple connected components, then you will expect that some of the sections $\sigma$ might be able to distinguish those connected components, and thus those sections of $f_* \mathcal{O}_X$ can't be viewed as functions on $Y$.
Why does normality come into play?  Well, the picture isn't quite as simple as what I just described.  If a scheme $Z$ is non-normal, and its normalization $Z' \to Z$ is injective/bijective (for example, the normalization of the cusp), then you should view that normalization map as the inclusion of all the ``algebraic functions'' which can be defined on the points.
In fact, given any scheme $Z$ over an algebraically closed field of characteristic zero, the seminormalization $Z'$ of $Z$ can be exactly described as ``the scheme whose structure sheaf has all functions that make sense on the closed points of $Z$.''
This is the point of view on seminormalization is described in:
Leahy and Vitulli, Seminormal rings and weakly normal varieties.  Nagoya Math. J.  82  (1981), 27–56
A: If $f:X\to Y$ is a proper morphism of noetherian shemes, then $f_*O_X=O_Y$ says that the fibers of $f$ are connected. This follows from a general form of Zariski's main theorem (Hartshorne III.11.3). 
Conversely, if $Y$ is in addition normal, then $f_*O_X=O_X$ holds. Indeed, there is a Stein factorization of the form
$$
X \xrightarrow{f'}  Z={\bf Spec} (f_* O_X) \xrightarrow{g} Y
$$where $g$ is finite and $f'$ has connected fibers. Furthermore $g_*O_Z=O_Y$ and 
${f'}_*O_X=O_Z$. If the fibers of $f$ are connected, then $g$ must be birational (by Hartshorne III.10.3) and is in fact an isomorphism if $Y$ is normal. It follows that $f_*O_X=O_Y$ if and only if $f$ has connected fibers. 
