If $f$ is in the span of eigenfunctions, then $|f|$ is also in the span of eigenfunctions. Let $(X,\mathscr{B},\mu,T)$ be a measure preserving dynamical system. Then $U_T:L^2(X,\mu)\rightarrow L^2(X,\mu)$ defined by $U_Tf=f\circ T$ is an isometry. Let $\mathscr{E}$ be the eigenspace(closed) of $U_T$.
Problem: If $f$ is in $\mathscr{E}$, then show that $|f|$ is also in $\mathscr{E}$.
Maybe a possible hint. The above problem will be solved if we can prove that $L^\infty(X)\cap \mathscr{E}$ is dense in $\mathscr{E}$. See the discussion before Proposition 4.19.
This result is essentially used to prove Lemma 4.23 of Recurrence in Ergodic Theory and Combinatorial Number Theory by Furstenberg, but I am not able to decode the argument given there. 
 A: Let $F$ be the $L^2$ closure of $L^{\infty}(X) \cap \mathscr{E}$. 
To show that $F=\mathscr{E}$, it is enough to prove that every eigenfunction is in $F$. 
So if $f$ is a $L^2$ eigenfunction with eigenvalue $\lambda$, then $|\lambda|=1$. 
For each $R >0$, let $g_R(z)=z$ if $|z| \leq R$ and $g_R(z)=R\frac{z}{|z|}$. Denote $f_R=g_R \circ f$. 
Since $g_R$ commutes with all rotations, $f_R$ is an eigenfunction $L^{\infty}$. Besides $f_R \rightarrow f$ in $L^2$. 
Thus $L^{\infty} \cap \mathscr{E}$ is dense in $\mathscr{E}$. Actually, we proved a stronger result: $\mathscr{E}$ is the $L^2$-closure of the vector subspace generated by $L^{\infty}$ eigenfunctions (let’s call it $G$). 
Note now that $L^{\infty}(X)$ is an algebra, and that $U_T$ is linear and multiplicative (from $L^{\infty}$ to itself), the set of $L^{\infty}$ eigenfunctions is thus multiplicative. Therefore, the subspace it spans in $L^{\infty}(X)$ (ie $G$) is a subalgebra. For a similar reason, it is also stable under complex conjugation.
Now we show that if $f \in G$, $f \geq 0$, then $\sqrt{f}$ is in the $L^{\infty}$ (hence $L^2$) closure of $G$. 
Indeed, let $R >0$ be such that $f \leq R$ ae. 
There is a sequence of polynomials $P_n$ such that $P_n(x) \rightarrow \sqrt{x}$ uniformly in $0 \leq x \leq R$. 
Thus, for each $n$, $P_n(f) \in G$, and $P_n(f)$ converges to $\sqrt{f}$ in $L^{\infty}$. 
In particular, if $f \in G$, then $|f|=\sqrt{f\overline{f}}$ is in the $L^2$ closure of $G$ (aka $\mathscr{E}$)
Now, if $f \in \mathscr{E}$, there exists a sequence $f_n \in G$ converging to $f$ with the $L^2$ norm. Then $|f_n| \in \mathscr{E}$ for all $n$. Since $|f_n| \rightarrow |f|$, $|f|\in \mathscr{E}$. 
A: Suppose that $U_T f = \lambda f$ for some eigenvalue $\lambda$. Since $U_T$ is an isometry, our only possible eigenvalues are $\pm 1$ (since otherwise, $\Vert U_T f \Vert = | \lambda | \Vert f \Vert \neq \Vert f \Vert$). 
If $\lambda = 1$, we have that $U_T |f| = |f \circ T|= |f|$, so $|f|$ is in the eigenspace with eigenvalue 1. Likewise, if $\lambda = -1$, we have that $U_T |f| = |f \circ T | = |-f| = |f|$, so again $|f|$ is in the eigenspace with eigenvalue 1.
EDIT. This is not an answer, see comment below.
