3. If the function $f(x)=\cos n x \cdot \sin \frac{4}{n} x(n \in \mathbf{Z})$ has a period of $3 \pi$, then the set of values for $n$ is
3. $\{ \pm 2, \pm 6\}$.

From $f(3 \pi)=f(0)=0$, we get $\sin \frac{12 \pi}{n}=0$, so $n \mid 12$.
From $f(x+3 \pi)=\cos (n x+3 n \pi) \sin \left(\frac{4}{n} x+\frac{12 \pi}{n}\right)$, it is easy to see that $3 n$ and $\frac{12}{n}$ are both integers and one of them must be even. If one is odd, then $f(x+3 \pi)=\cos (n \pi+x) \sin \frac{4}{n} x$ or $\cos n x \cdot \sin \left(\frac{4}{n} x+\pi\right)$, i.e., $f(x+3 \pi)=f(x)$, which does not meet the requirement. Therefore, $3 n$ and $\frac{12}{n}$ are both even, in which case $f(x+3 \pi)=f(x)$ always holds. Hence, $n= \pm 2, \pm 6$ satisfy the condition.