Q:

Injective or constant function on measurable cardinal

I'm working on the following question:

Let $\kappa$ regular cardinal, and $f:\kappa \rightarrow \kappa$.

Prove that $\{\alpha < \kappa\mid f|_\alpha : \alpha \rightarrow \alpha\}$ is a club set
$\kappa$ is measurable. Let $U$, non-trivial, normal, $\kappa$-complete ultrafilter on $\kappa$. Prove that there exists $X \in U$ such that $f$ is constant on $X$, or $f$ is injective on $X$

Solved the first part, but I'm not sure what to do with the second part.
Thanks!
Edit: (definitions)
We defined the relation 

$f \leq_U g \iff \{\alpha < \kappa \mid f(\alpha) \leq g(\alpha)\} \in U$

and proved that it is a well ordering on the equivalence classes of $\kappa \rightarrow On$ under $=_U$. Then we defined $U$ is normal iff $id$ is the minimal function above the constant functions in this ordering.

A:

Define a coloring $c:[\kappa]^2 \rightarrow \{0, 1\}$ as follows $c(\{\alpha, \beta\}) = 0$ iff $f(\alpha) = f(\beta)$. Let $d:\kappa \rightarrow \{0, 1\}$ be defined by $d(\alpha) = 0$ if $A_{\alpha} = \{\beta < \kappa: c(\{\alpha, \beta\}) = 0\} \in U$ and $d(\alpha) = 1$ if $B_{\alpha} = \{\beta < \kappa : c(\{\alpha, \beta\}) = 1\} \in U$. Then $d$ is constant on a set $X \in U$. 
Suppose for every $\alpha \in X$, $d(\alpha) = 0$. Then by normality of $U$, the diagonal intersection of $A_{\alpha}$'s, $D = \{\alpha < \kappa : (\forall \beta < \alpha)(\alpha \in A_{\beta})\} \in U$. For any $\beta < \alpha$ in $D$ we have $\alpha \in A_{\beta}$ so $c(\{\alpha, \beta\}) = 0$. Hence $f$ is constant on $D$.
The case when $d$ is $1$ on $X$ is dealt similarly.
Addendum: If $W = \kappa \backslash D \in U$, then the function $r:W \rightarrow \kappa$ defined by $r(\alpha) = \text{least } \beta \text{ such that } \alpha \notin A_{\beta}$ is regressive, non constant on a set in $U$ and below the identity.

