TITLE: geometrically integral fibres
QUESTION [9 upvotes]: Let $X$, $Y = \mathrm{Spec}(A)$ be Noetherian schemes and $f: X \to Y$ be proper with geometrically integral fibres. I want to show this implies $\mathcal{O}_Y = f_*\mathcal{O}_X$.
My idea was to reduce to $A$ local, use the theorem on formal functions and that the completion is faithfully flat and that for a connected reduced scheme $X$ over an algebraically closed field $k$, one has $H^0(X,\mathcal{O}_X) = k$.
I can show that $H^0(X,\mathcal{O}_X)$ is a finite local $A$-algebra. It probably suffices to show that $H^0(X \times_A A/\mathfrak{m}^n) =  A/\mathfrak{m}^n$ (then apply the formal function theorem and the faithful flatness of the completion).

REPLY [2 votes]: I have to redraw the proof, because the result in Hartshorne I thought to requires $f$ to be flat. 
There is in fact a counterexample without further assumption on $f$: 
Suppose $A$ has non-trivial nilradical $I$. Let $X=\mathrm{Spec}(A/I)$ and let $f : X\to Y$ be the closed immersion. Then for all $y\in Y$, $X_y=\mathrm{Spec}(k(y))$ is geometrically integral. But $f_*O_X=A/I$ is not equal to $A=O_Y$.

Suppose we are in the situation where $Y$ is local with closed points $y$. As $X_y$ is geometrically integral, we have $H^0(X_y, \mathcal O_{X_y})=k(y)$. So the canonical map 
$$ H^0(X, \mathcal O_X)\otimes_A k(y)\to H^0(X_y, \mathcal O_{X_y})=k(y)$$ 
is surjective. This implies that the canonical map 
$$ H^0(X, \mathcal O_X)\otimes_A M\to H^0(X, \mathcal O_{X}\otimes_A M)$$
is an isomorphism for any finitely generated $A$-module $M$ (see Hartshorne, III, §12). Now apply this to $M=A/\mathfrak m^n$ and you can conclude as in your post.