Let $f: X \to Y$ be a morphism of ringed spaces. I'm looking for criteria for $f, X,Y$ such that the morphism
$$\mathcal{O}_Y \to f_*\mathcal{O}_X $$
is an isomorphism.
Obviously, a necessary condition is that $f_*\mathcal{O}_X$ is locally free of dimension $1$ (in other words an invertible sheaf). But does it suffice to get an isomorphism?
I heard often there are criteria like that $Y$ has to be normal or $X$ projective.
Could anybody explain if there exist a intuitive access to understand when one can expect that $\mathcal{O}_Y \cong f_*\mathcal{O}_X $ hold and what are the obstacles which could prevent this from being isomorphic.
Is there a geometric intuition behind this phenomenon when it occurs?
My considerations:
Locally $\mathcal{O}_Y \to f_*\mathcal{O}_X $ for affine $U \subset Y$ it is given by ring maps $\mathcal{O}_Y(U)=: R \to f_*\mathcal{O}_X(U)=:A$.
So for example if $R$ is normal and $f$ finite this gives an isomorphism.
What about the intuition if $X$ is projective? Can the concepts and these two examples be considered from a much more sophisticated viewpoint?