Fix a scheme $S$ and let $X$ and $Y$ be $S$-schemes. Assume that $X$ is proper over $S$ and $Y$ is separated over $S$. Let $f: X \rightarrow Y$ be an open immersion of $S$-schemes. If $Y$ is connected, show that $f$ is an isomorphism.
Here's another exercise I encountered. I'm not exactly sure how to use the properties ascribed to $Y$ to prove this. Any help would be appreciated!