Solution (source code)

= Solution

For a one-dimensional <character>, write $\chi(i)=\epsilon$ and $\chi(j)=\eta$. Since $\chi(-1)=1$, the relations $i^2=j^2=-1$ require $\epsilon,\eta\in\{\pm1\}$. Also $ij=k$ gives $\chi(k)=\epsilon\eta$. The four sign choices therefore supply all four linear characters.

For the remaining two-dimensional <character> $\chi_2$, its value at the identity is two. Column <orthogonality> between the identity and $-1$ gives $4+2\chi_2(-1)=0$, so $\chi_2(-1)=-2$. Between the identity and each of the other classes, the four linear-character values sum to zero, forcing the remaining <character> values to vanish. Thus the <character table> is
$$
\boxed{\begin{array}{c|ccccc}
&\{1\}&\{-1\}&\{\pm i\}&\{\pm j\}&\{\pm k\}\\\hline
\text{class size}&1&1&2&2&2\\\hline
\chi_{++}&1&1&1&1&1\\
\chi_{+-}&1&1&1&-1&-1\\
\chi_{-+}&1&1&-1&1&-1\\
\chi_{--}&1&1&-1&-1&1\\
\chi_2&2&-2&0&0&0
\end{array}.}
$$
Here column <orthogonality> is the standard finite-group <character> theorem $\sum_\rho\chi_\rho(e)^*\chi_\rho(g)=0$ for $g\ne e$. The rows also have unit <norm> and are mutually orthogonal in the <character inner product> with the displayed class-size weights. This completes the <character table of the quaternion group>.