Counterexample
Let $K = \operatorname{End}(\mathbb{R}, +)$ be the endomorphism ring of the additive group of the reals. The ring $(\mathbb{R}, +, \cdot)$ embeds in $K$ via $r \mapsto \varphi_r$, $\varphi_r(x) = r \cdot x$. It is easy to prove that if $f \in K$ commutes with (the embedded copy of) $\mathbb{R}$, then $f \in \mathbb{R}$. Thus it suffices to construct an endomorphism $i \in K$ satisfying $i^2 = -1$.
Fix a basis $B$ of $\mathbb{R}$ as a $\mathbb{Q}$-vector space . Let $B = \{ b_j : j \in J \} \cup \{ c_j : j \in J \}$, where all $b_j$ and $c_k$ are distinct. Then there exists a unique $\mathbb{Q}$-linear map $i \in K$ such that $i(b_j) = c_j$ and $i(c_j) = -b_j$. The identity $i(i(x)) = -x$ holds on $B$, so it holds on $\mathbb{R}$. Thus $i^2 = -1$.