Prove that $x^2 + 1$ divides $f(x) - \frac{(f(i) - f(-i))}{2i} x - \frac{(f(i) + f(-i))}{2}$ in the ring $\mathbb{Q}(i)[x]$. Let $\mathbb{Q}(i) = \{a + bi ~|~ a, b \in \mathbb{Q}\}$. With addition and multiplication as in $\mathbb{C}$, $\mathbb{Q}(i)$ is a field.
(Note: You are not being asked to prove that $\mathbb{Q}(i)$ is a field.)
Let $f(x) \in \mathbb{Q}(i)[x]$. Prove that $x^2 + 1$ divides
\begin{align*}
    f(x) - \frac{(f(i) - f(-i))}{2i} x - \frac{(f(i) + f(-i))}{2}
\end{align*}
in the ring $\mathbb{Q}(i)[x]$.
$\textbf{My Attempt:}$
Since, $i, i^2, i^3, i^4 \in \mathbb{Q}(i)$. Also, $i^5 = i \in \mathbb{Q}(i)$.
So, for some $n \in \mathbb{N}$, $i^n \in \mathbb{Q}(i)$.
Since, we let $f(x) \in \mathbb{Q}(i)[x]$.
Let $f(x)$ has degree of $n$ where $n \in \mathbb{N} \cup \{ 0 \}$.
Then, $f(i) = a_n i^n + \cdots + a_0$ and $f(-i) = a_n (-i)^n + \cdots + a_0$. for some $a_j\in \mathbb{Q}(i)$.
Since, $\mathbb{Q}(i)$ is a field with addition and multiplication as in $\mathbb{C}$.
Then, $f(i) \in \mathbb{Q}(i)$ and $f(-i) \in \mathbb{Q}(i)$.
Also, $(f(i) - f(-i)) \in \mathbb{Q}(i)$ and $(f(i) + f(-i)) \in \mathbb{Q}(i)$.
Since, notice that $-\frac{1}{2i} = \frac{1}{2}i \in \mathbb{Q}(i)$.
Then, $-\frac{(f(i) - f(-i))}{2i} = (\frac{1}{2}i)(f(i) - f(-i)) \in \mathbb{Q}(i)$ and $-\frac{(f(i) + f(-i))}{2} = (-\frac{1}{2})(f(i) + f(-i)) \in \mathbb{Q}(i)$.
Let $\alpha = -\frac{(f(i) - f(-i))}{2i}$ and $\beta = -\frac{(f(i) + f(-i))}{2}$. Where $\alpha, \beta \in \mathbb{Q}(i)$.
Then, $f(x) - \frac{(f(i) - f(-i))}{2i}x - \frac{(f(i) + f(-i))}{2} = f(x) + \alpha x + \beta$.
Since, we let $f(x) \in \mathbb{Q}(i)[x]$ and we set $f(x)$ has a degree of $n$.
So, $f(x) = b_n x^n + \cdots + b_1 x + b_0$ where $b_j \in \mathbb{Q}(i)$.
Then, $f(x) + \alpha x + \beta = (b_n x^n + \cdots + b_1 x + b_0) + \alpha x + \beta = b_n x^n + \cdots + (b_1 + \alpha)x + (b_0 + \beta)$.
Since, $b_1, b_0, \alpha, \beta \in \mathbb{Q}(i)$. So, $(b_1 + \alpha), (b_1 + \beta) \in \mathbb{Q}(i)$.
Then, we set $g(x) = b_n x^n + \cdots + (b_1 + \alpha)x + (b_0 + \beta) = c_n x^n + \cdots + c_1 x + c_0$.
$~\hspace{10mm}$ Which $c_n = b_n$, ..., $c_1 = (b_1 + \alpha)$, $c_0 = (b_0 + \beta)$. Where each $c_j \in \mathbb{Q}(i)$.
Then, $g(x)$ has degree of $n$ as well.
Also, $g(x) = c_n x^n + \cdots + c_1 x + c_0 = f(x) - \frac{(f(i) - f(-i))}{2i}x - \frac{(f(i) + f(-i))}{2}$.
$~\hspace{10mm}$ Where $g(x)$ is in the ring $\mathbb{Q}(i)[x]$
Next, I want to prove that $x^2 + 1$ divides g(x) in the ring $\mathbb{Q}(i)[x]$:
Which I need to find a $h(x) \in \mathbb{Q}(i)$ such that $g(x) = (x^2 + 1)h(x)$.
But I don't know how to find it. And I don't think it always work since if $g(x) = x + 1$. Then, I cannot find a $h(x)$.
 A: Your solution is very hard to read. Note that $x+i$ and $x-i$ are coprime and so for a polynomial to be divisible by $(x+i)(x-i) = x^2+1$ if suffices for it to have $i$ and $-i$ as roots.
A direct computation shows that
$$
\begin{align*}
    f(i) - \frac{(f(i) - f(-i))}{2i} i - \frac{(f(i) + f(-i))}{2} = f(i)-f(i) = 0
\end{align*}
$$
and
\begin{align*}
    f(-i) - \frac{(f(i) - f(-i))}{2i} (-i) - \frac{(f(i) + f(-i))}{2} = f(-i)-f(-i) = 0.
\end{align*}
A: More conceptually, it's a special case of Lagrange interpolation [= a special case of CRT], viz.
$$\begin{align} &f(x) \,\equiv\ f(a)\, +\, (x-a)\ \dfrac{f(b)-f(a)}{b-a}\ \ \pmod{(x\!-\!a)(x\!-\!b)},\,\ a\neq b\\[.2em]
\overset{\textstyle a,b=\pm i}\Longrightarrow\ &f(x) \,\equiv\, f(-i) + (x+i)\ \dfrac{f(i)-f(-i)}{2i}\!\pmod{x^2+1}
\end{align}$$

Or, directly applying the CRT = Chinese Remainder Theorem formula
$$\begin{align}
   &\!\begin{array}{l} 
      f(x)\,\equiv\,  f(i)\ \ \ \ \pmod{x-i}\\
      f(x)\,\equiv\, f(-i)\ \pmod{x+i}
   \end{array}\\[.4em]
 \iff\ & f(x) \,\equiv\, \dfrac{x+i}{2i}\, f(i) + \dfrac{x-i}{-2i}\, f(-i)\pmod{(x-i)(x+i)}\\[.6em]
 &\ \ \ \ \ \ \ \ \equiv\, \dfrac{f(i)+f(-i)}2 + \dfrac{f(i)-f(-i)}{2i}\,x\pmod{\!x^2+1}
\end{align}\qquad\quad$$
See here for a conceptual derivation of the common CRT formula applied above.
