This is a somewhat technical remark, related to Andrea's answer, which is a bit too big to fit into the comment box. If $f: Y \rightarrow T$ has connected fibres, to conclude that $R^0f_*\mathcal O_Y = \mathcal O_T$, one needs some assumptions beyond just that $f$ is a projective morphism of Noetherian schemes. (Consider these examples: a closed embedding will have connected fibres. To give such an example in which all fibres non-empty, consider a non-reduced $T$, and let $Y$ be the underlying reduced subscheme. Or one could take $T$ to be a cuspidal cubic curve and $Y$ to be its normalization.) What the theorem on formal functions shows (assuming that $f$ is projective, and that $Y$ and $T$ are Noetherian, so we can apply the result as it is proved in Hartshorne) is that for any point $P$ in $T$, the $\mathfrak m_P$-adic completion $(R^0f_*\mathcal O_Y\hat{)}_P$ is equal to $H^0(\hat{Y}_P,\mathcal O)$, the global sections of the structure sheaf on the formal fibre $\hat{Y}_P$ over $P$. So if $f$ has connected fibres, and hence connected formal fibres, so that $H^0(\hat{Y}\_P,\mathcal O)$ is a local ring, we see that $(R^0f_*\mathcal O_Y\hat{)}_P$ is a finite local $\hat{\mathcal O}\_{T,P}$-algebra. In general, one can't do better than this. But, if $f$ is flat with geometrially connected and reduced fibres (e.g $f$ is smooth with geometrically connected fibres), then base-change for flat maps (Hartshorne III.9.3) shows that the fibre mod $\mathfrak m_P$ of $R^0f_*\mathcal O_Y$ is equal to $H^0(Y_P,\mathcal O_P)$ (the actual fibre over $P$, now, not the formal fibre), which equals $k(P)$ (the residue field at $P$), since $Y_P$ is projective, geometrically reduced, and geometrically connected over $k(P)$. So, maintaining these assumptions on $f$, we see that for each point $P$ of $T$, the stalk $(R^0f_*\mathcal O_Y)_P$ is a finite $\mathcal O\_{T,P}$-algebra with the property that its reduction modulo $\mathfrak m_P$ is isomorphic to the residue field $k(P)$ of ${\mathcal O}\_{T,P}$. This implies (by Nakayama) that the natural map ${\mathcal O}\_P \rightarrow (R^0f_*\mathcal O_Y)\_P$ is surjective. This is true at every $P$, and so we see that $\mathcal O_T \rightarrow R^0f_*\mathcal O_Y$ is surjective. Now one can combine this with the Grauert result to conclude (since a surjection of invertible sheaves is necessarily an isomorphism) that the natural map $\mathcal O_T \rightarrow R^0f_*\mathcal O_Y$ is an isomorphism. (We probably don't need to use the full force of Grauert here; for example, suppose that $T$ is connected; a flat map is open, and a projective map is closed, so $f$ is surjective, hence faithfully flat, and this implies that the map $\mathcal O_T \rightarrow R^0f_*\mathcal O_Y$ is injective, I think.) Added: See Keerthi Madapusi's answer below for a correction to the above discussion of flat base-change.