Let $(X,\mathcal{S}, \mu)$ be a measure space with $X$ a locally compact Hausdorff space, $\mathcal{S}$ the Borel subsets of $X$ and $\mu$ a complex measure. Suppose that $$ \int_X f \ d\mu \in \mathbb{R} $$ for all $f\in C( X,\mathbb{R} )$ i.e. the continous functions from $X$ to $\mathbb{R}$. I want to know if this implies that $\mu$ is a real measure? Of course with $f\equiv1$ we have that $\mu(X) \in \mathbb{R}$, but does this necessarily implies that $\mu(E)\in \mathbb{R}$ for all $E \in \mathcal{S}?$
I am incline to think that $\mu$ must be a regular measure for this to happen.
Seems to me that you need to add a couple more hypothesis. As you say the fact that $\mu$ is regular is crucial, but you also need that $\int f d\mu \in \mathbb{R}$ for all $f \in C_c(X)$ (of course if $X$ is compact it self, then $C_c(X)=C(X)$)
With all this, then indeed $\mu$ is a real measure. To prove it, take any $E \in \mathcal{S}$, now since $C_c(X)$ is dense in $L^1(X, \mu)$, we can find a sequence $(f_n)_n \subset C_c(X)$ such that $\|f_n-\chi_{E}\|_1 \to 0$ as $n \to \infty$. Moreover since $\mu$ is a complex regular measure, then $|\mu|(X)<\infty$, so $$ \left| \int (f_n-\chi_{E}) d\mu \right| \leq \|f_n-\chi_{E}\|_1 |\mu|(X) \to 0\text{ as $n \to \infty$} $$ and therefore $$ \mu(E) = \int \chi_E d\mu = \lim_{n \to \infty} \int f_n d\mu \in \mathbb{R} $$ since by the hypothesis each $\int f_n d\mu \in \mathbb{R}$.