Example 6 Let $t_{1}, t_{2}$ be the two distinct real roots of the equation $t^{2}-(5 a-2) t-3 a^{2}-7 a+1=0$. Find the value of the real number $a$ such that for any non-zero real number $m$, the function $f(x)=\cos (m \pi x) \cos \left[\left(t_{1}^{3}+t_{2}^{3}\right) \pi x\right]$ is a periodic function.
Let $T$ be the smallest positive period of the function $f(x)$, then we have $f(T)=f(0)$, i.e., $\cos (m \pi T) \cos \left[\left(t_{1}^{3}+t_{2}^{3}\right) \pi T\right] = 1$. By the boundedness of the cosine function, we get $\left\{\begin{array}{l}|\cos (m \pi T)|=1, \\ \left|\cos \left[\left(t_{1}^{3}+t_{2}^{3}\right) \pi T\right]\right|=1 .\end{array}\right.$

Therefore, $\left\{\begin{array}{l}m \pi T=k_{1} \pi, \\ \left(t_{1}^{3}+t_{2}^{3}\right) \pi T=k_{2} \pi .\end{array} \quad\left(k_{1}, k_{0} \in \mathbf{Z}, k_{1} \neq 0\right)\right.$, hence $\frac{t_{1}^{3}+t_{2}^{3}}{m}=\frac{k_{2}}{k_{1}}$. That is, for any non-zero real number $m$, $\frac{t_{1}^{3}+t_{2}^{3}}{m}$ is a rational number. Therefore, we must have $t_{1}^{3}+t_{2}^{3}=0$, i.e., $\left(t_{1}+t_{2}\right)\left(t_{1}^{2}-t_{1} t_{2}+t_{2}^{2}\right)=0$.

Since $t_{1}, t_{2} \in \mathbf{R}$, and $t_{1} \neq t_{2}$, we have $t_{1}^{2}-t_{1} t_{2}+t_{2}^{2} \neq 0$. Hence, $t_{1}+t_{2}=0$. By Vieta's formulas, we get $5a-2=0$, i.e., $a=\frac{2}{5}$.

At first glance, this problem seems intractable, but by cleverly setting the period and combining the boundedness of the trigonometric function with Vieta's formulas, we can solve it. Truly, "when the mountains and waters seem to block the way, there is a village with willows and flowers," making one exclaim in admiration.