I came across this problem in my study of set theory and am not quite sure how to approach it. A solution or starting point would be welcome.
Prove that if $\mathcal U$ is a nonprincipal ultrafilter over over $\omega$, then the following are equivalent:
(a) $\mathcal U$ is a Ramsey ultrafilter.
(b) For all $f: \omega \to \omega$ there exists $X \in \omega$ such that $f\restriction X$ is either an injective function or a constant function.
As a note, by a Ramsey ultrafilter, I mean a nonprincipal ultrafilter $\mathcal U$ on $\omega$ such that for every $\mathcal X: ( \omega )^{2} \to 2$ there exists a $\mathcal X$-monochromatic $A \in \mathcal U$.