The answer is completely described by the Frobenius–Schur indicator, $$v_2(\chi) = \frac{1}{|G|}\sum_{g\in G} \chi(g^2)$$
which is covered in chapter 4 of Isaacs's Character Theory of Finite Groups. In particular, we have the Frobenius–Schur theorem, as given on page 58 of Isaacs's CToFG:
Theorem: If $\chi$ is an irreducible (ordinary, complex) character of the finite group $G$, then $$v_2(\chi) = \begin{cases}
1 & \chi \text{ is the character of an irreducible real representation} \\
0 & \chi \text{ takes complex values } \\
-1 & \text{otherwise}
\end{cases}$$
If $v_2(\chi)=1$, $\chi$ is the character of a real representation. If $v_2(\chi)=0$, then $\chi + \bar \chi$ is the character of a real representation. If $v_2(\chi)=-1$, then $2\chi = \chi + \bar \chi$ is the character of a real representation.
The following is Lemma 9.18 (more or less) in Isaacs's CToFG:
Proposition: If $\chi$ is a (ordinary, complex) character of the finite group $G$, then $\chi + \overline{\chi}$ is the character of a real representation of $G$. More generally, if $K \leq F$ are fields of characteristic 0 and $\chi$ is the character of a (ordinary) $F$-representation of $G$, then for every $\sigma \in \operatorname{Gal}(F/K)$, $\chi^\sigma = g \mapsto \sigma(\chi(g))$ is the character of a (ordinary) $F$-representation of $G$, and $$\sum_{\sigma \in \operatorname{Gal}(F/K)} \chi^\sigma$$ is the character of a $K$-representation.
Proof: If $\chi$ is the character of the representation $X$, then consider the representation $X \otimes_{\mathbb{C}} \mathbb{C}_\mathbb{R} \cong X \oplus \bar X$ obtained by replacing the complex entries $a+bi$ of $X$ with the block matrices $\begin{bmatrix} a & b \\ -b & a \end{bmatrix}$. The resulting matrix has trace $\chi(g) + \bar\chi(g)$, since we replace each diagonal entry $a+bi$ with a matrix of trace $2a$. The general case is similar: just choose a $K$-basis of $F$, and write out the associated matrix representation of $f \in F$ in its action on the $K$-vector space $F$. $\square$
Since you mention GAP, I'll mention the indicators of a character table are computed using Indicator( chartable, 2)
and that since every complex, ordinary representation of $G$ is a representation over the field CF(Exponent(G))
, the $\sigma$ appearing in the Galois group are given by chi -> GaloisCyc(chi,k)
for $k$ relatively prime to $G$. In particular, $k=-1$ is complex conjugation. To compute the matrices of the $K$-representation from the $F$-representation as described in the proof, you can use BlownUpMat(Basis(AsVectorSpace(K,F)),mat)
.
The function RationalizedMat
can be applied to a character table to compute some smaller sums where one needs to multiple by the so called Schur index as in Geoff Robinson's answer: for example, it would take a real character and leave it real, even if its indicator were $-1$. However, for Brauer characters (where the Schur indices are always 1), it can be very handy.
At any rate, chapters 4, 9, and 10 of Isaacs's textbook are great for understanding how characters work over different fields of characteristic 0 and how that relates to the power maps of the character table.