[proofplan]
We fix an arbitrary coloring of unordered pairs from $\kappa$ into two colors and build the standard Erdős-Rado tree of approximation functions. Each node records the color pattern that a later ordinal induces on all earlier ordinals below some bounded level. Inaccessibility ensures that each level has size less than $\kappa$, so the tree property gives a cofinal branch. From that branch we recursively choose a strictly increasing sequence of ordinals, and then thin it to one of the two branch-colors to obtain a homogeneous subset of cardinality $\kappa$.
[/proofplan]
[step:Build the Erdős-Rado tree from the coloring]
Let $2:=\{0,1\}$, and fix a coloring $c:[\kappa]^2 \to 2$. For each ordinal $\beta<\kappa$, define the color-profile map
Define $r_\beta:\beta \to 2$ by $r_\beta(\alpha)=c(\{\alpha,\beta\})$.
Thus $r_\beta$ records the colors assigned by $c$ to pairs whose larger element is $\beta$.
Define a tree $T$ as follows. A node of $T$ is a function $t:\alpha \to 2$ for some ordinal $\alpha<\kappa$ such that there exists an ordinal $\beta$ with $\alpha \leq \beta<\kappa$ and
This means $t = r_\beta|_\alpha$.
The height of such a node is $\operatorname{ht}_T(t):=\alpha$. The tree order is extension: for nodes $s:\gamma \to 2$ and $t:\alpha \to 2$, write $s \leq_T t$ if $\gamma \leq \alpha$ and $s=t|_\gamma$.
This is a tree of height $\kappa$. Indeed, for every $\alpha<\kappa$, the function $r_\alpha:\alpha \to 2$ witnesses that $r_\alpha|_\alpha \in T$ has height $\alpha$. If $t=r_\beta|_\alpha$ and $\gamma<\alpha$, then $t|_\gamma=r_\beta|_\gamma$, so every predecessor of a node of $T$ is again in $T$. The predecessors of any node $t:\alpha\to 2$ are exactly its restrictions $t|_\gamma$ for $\gamma<\alpha$, ordered by $\gamma$, and hence are well-ordered by $\leq_T$.
[/step]
[step:Use inaccessibility to verify that the constructed tree is a $\kappa$-tree]
For each $\alpha<\kappa$, let
Define $T_\alpha := \{t\in T : \operatorname{ht}_T(t)=\alpha\}$.
denote the $\alpha$-th level of $T$. Since each element of $T_\alpha$ is a function from $\alpha$ to $2$, we have an injection
Thus $T_\alpha \subseteq 2^\alpha$.
Because $\kappa$ is inaccessible, it is a strong limit cardinal. Therefore $2^{|\alpha|}<\kappa$ for every $\alpha<\kappa$. Hence
Hence $|T_\alpha| \leq |2^\alpha| = 2^{|\alpha|} < \kappa$.
Thus $T$ has height $\kappa$, every level of $T$ has cardinality less than $\kappa$, and $T$ is a $\kappa$-tree.
[/step]
[step:Apply the tree property to obtain a coherent global color profile]
Since $\kappa$ has the tree property and $T$ is a $\kappa$-tree, there is a cofinal branch $B\subset T$. Define
Define $b:\kappa \to 2$ by $b(\alpha)=t(\alpha)$ for any $t\in B$ with $\alpha<\operatorname{ht}_T(t)$.
This is well-defined because $B$ is linearly ordered by extension: if $s,t\in B$ both have domain above $\alpha$, then either $s\leq_T t$ or $t\leq_T s$, and the larger node extends the smaller. Since $B$ is cofinal in $T$, for every $\alpha<\kappa$ the restriction $b|_\alpha$ belongs to $T_\alpha$. Consequently, for every $\alpha<\kappa$ there exists some $\beta$ with $\alpha\leq\beta<\kappa$ such that
\begin{align*}
b|_\alpha = r_\beta|_\alpha.
\end{align*}
[/step]
[step:Decode the branch into a sequence whose pair colors are controlled by the branch]
We recursively define a strictly increasing sequence $(\beta_\xi)_{\xi<\kappa}$ of ordinals below $\kappa$. Suppose $\xi<\kappa$ and $\beta_\eta$ has been chosen for every $\eta<\xi$. Define
Set $\delta_\xi := \sup\{\beta_\eta+1 : \eta<\xi\}$, with $\delta_0 := 0$. Since $\kappa$ is regular and $\xi<\kappa$, the set $\{\beta_\eta+1:\eta<\xi\}$ has cardinality less than $\kappa$, so $\delta_\xi<\kappa$.
Because $b|_{\delta_\xi}\in T_{\delta_\xi}$, there exists an ordinal $\beta_\xi$ with $\delta_\xi\leq \beta_\xi<\kappa$ and
\begin{align*}
b|_{\delta_\xi}=r_{\beta_\xi}|_{\delta_\xi}.
\end{align*}
This choice is possible at every stage $\xi<\kappa$. Also, if $\eta<\xi$, then $\beta_\eta<\delta_\xi\leq \beta_\xi$, so the sequence is strictly increasing.
For $\eta<\xi<\kappa$, the inequality $\beta_\eta<\delta_\xi$ gives
\begin{align*}
c(\{\beta_\eta,\beta_\xi\}) = r_{\beta_\xi}(\beta_\eta)=b(\beta_\eta).
\end{align*}
Thus, along the sequence $(\beta_\xi)_{\xi<\kappa}$, the color of the pair whose smaller element is $\beta_\eta$ is determined by the branch value $b(\beta_\eta)$.
[guided]
The branch $b:\kappa\to 2$ is not itself a homogeneous set; it is a coherent prediction of color profiles. To turn it into actual ordinals, we choose ordinals one at a time so that each new ordinal realizes a long enough initial segment of the branch.
Assume that we have already chosen $\beta_\eta<\kappa$ for every $\eta<\xi$. We need the next ordinal to be larger than all previous choices and to realize the branch values on all those previous choices. Define the bound
\begin{align*}
\delta_\xi := \sup\{\beta_\eta+1:\eta<\xi\},
\end{align*}
and set $\delta_0:=0$ when $\xi=0$. The set whose supremum is being taken has cardinality at most $|\xi|$, hence less than $\kappa$. Since $\kappa$ is regular, the supremum of fewer than $\kappa$ ordinals below $\kappa$ is still below $\kappa$, so $\delta_\xi<\kappa$.
Now use the fact that $b$ came from a cofinal branch through $T$. The restriction $b|_{\delta_\xi}$ is a node on level $\delta_\xi$ of $T$. By the definition of $T$, this means that there is some ordinal $\beta_\xi$ with $\delta_\xi\leq \beta_\xi<\kappa$ such that
\begin{align*}
b|_{\delta_\xi}=r_{\beta_\xi}|_{\delta_\xi}.
\end{align*}
This equality says exactly that $\beta_\xi$ has the branch-prescribed color pattern against every ordinal below $\delta_\xi$.
In particular, if $\eta<\xi$, then $\beta_\eta<\delta_\xi\leq\beta_\xi$. Therefore the sequence is strictly increasing. Moreover, since $\beta_\eta<\delta_\xi$, evaluating the equality $b|_{\delta_\xi}=r_{\beta_\xi}|_{\delta_\xi}$ at $\beta_\eta$ gives
\begin{align*}
r_{\beta_\xi}(\beta_\eta)=b(\beta_\eta).
\end{align*}
By the definition of $r_{\beta_\xi}$, this is the same as
\begin{align*}
c(\{\beta_\eta,\beta_\xi\})=b(\beta_\eta).
\end{align*}
So every pair chosen from the sequence has its color controlled by the branch value at the smaller member.
[/guided]
[/step]
[step:Thin the decoded sequence to one branch-color]
Let
\begin{align*}
A := \{\beta_\xi:\xi<\kappa\}.
\end{align*}
Since $(\beta_\xi)_{\xi<\kappa}$ is strictly increasing, $|A|=\kappa$. Define two subsets of $A$ by
\begin{align*}
A_i := \{\beta_\xi\in A:b(\beta_\xi)=i\}
\end{align*}
for $i\in 2$. Then $A=A_0\cup A_1$. If both $A_0$ and $A_1$ had cardinality less than $\kappa$, their union would have cardinality less than $\kappa$, contradicting $|A|=\kappa$. Hence there is some $i\in 2$ such that $|A_i|=\kappa$.
Set $H:=A_i$. If $\alpha,\beta\in H$ and $\alpha<\beta$, then there are ordinals $\eta<\xi<\kappa$ such that $\alpha=\beta_\eta$ and $\beta=\beta_\xi$. By the decoding property proved above,
\begin{align*}
c(\{\alpha,\beta\}) = c(\{\beta_\eta,\beta_\xi\}) = b(\beta_\eta)=i.
\end{align*}
Thus $H\subset\kappa$ has cardinality $\kappa$ and is homogeneous of color $i$ for $c$. Since $c:[\kappa]^2\to 2$ was arbitrary, this proves $\kappa\to(\kappa)^2_2$.
[/step]