I am interpreting the question as follows: consider $S^1$ as $\mathbb{R} / \mathbb{Z}$ with its usual group operation (translation), to be denoted $+$. When you say "$f$ is invariant under $\mathbb{Q} / \mathbb{Z}$", I take that to mean "for every $y \in S^1$ and every $x \in \mathbb{Q} /\mathbb{Z}$, we have $f(y) = f(x+y)$".
As you say, it's sufficient to assume $f$ is bounded (or even an indicator function). For $x \in S^1$, let $\tau_x f(y) =f(x+y)$ be the translation by $x$ and consider $x \mapsto \tau_x f$ as a map from $S^1$ to $L^1(S^1)$. It's standard to show this map is continuous. (It would be easy if $f$ were (uniformly) continuous; otherwise, use the density of $C(S^1)$ in $L^1(S^1)$ and the triangle inequality.) Since $f = \tau_x f$ a.e. for all $x \in \mathbb{Q} / \mathbb{Z}$, we have the same for all $x \in S^1$.
Consider the set $A = \{(x,y) \in (S^1)^2 : f(y) = f(x+y)\}.$ Clearly $A$ is measurable, and we just showed the section $A_x$ is null for every $x$. So by Fubini, $A$ is null; in particular there exists $y_0$ such that the section $A^{y_0}$ is null. This means that $f(y_0) = f(x+y_0)$ for almost every $x$, which is to say $f$ is a.e. constant.
(There should be a neater way to do this by interchanging integrals and thus showing that $f$ equals its average value almost everywhere. I haven't had enough coffee yet to sort it through, so I leave it as an exercise. :-)
I think this would go through for any dense subset of a compact group.