Example 7 Let $f(x)=\lg \frac{1+2^{x}+\cdots+(n-1)^{x}+n^{x} a}{n}$, where $a$ is a real number, $n$ is any given positive integer, and $n \geqslant 2$.
(1) If $f(x)$ is meaningful for $x \in(-\infty, 1]$, find the range of values for $a$;
(2) If $a \in(0,1]$, prove that $2 f(x)<f(2 x)$ when $x \neq 0$.
(1) According to the problem, when $x \in(-\infty, 1]$, $1+2^{x}+\cdots+(n-1)^{x}+n^{x} \cdot a>0$ always holds. Since $n^{x}>0$, we have $a>-\left[\left(\frac{1}{n}\right)^{x}+\left(\frac{2}{n}\right)^{x}+\cdots+\left(\frac{n-1}{n}\right)^{x}\right], x \in(-\infty, 1]$. Let $g(x)=-\left[\left(\frac{1}{n}\right)^{x}+\left(\frac{2}{n}\right)^{x}+\cdots+\left(\frac{n-1}{n}\right)^{x}\right]$. Then the problem is converted to finding the maximum value of $g(x)$.
Since $0<\frac{k}{n}<1,1 \leqslant k \leqslant n-1$. And $x \in(-\infty, 1]$, by the monotonicity of the exponential function, we have
$$
\left(\frac{1}{n}\right)^{x}+\left(\frac{2}{n}\right)^{x}+\cdots+\left(\frac{n-1}{n}\right)^{x} \geqslant\left(\frac{1}{n}\right)^{\prime}+\left(\frac{2}{n}\right)^{\prime}+\cdots+\left(\frac{n-1}{n}\right)^{\prime}=\frac{n-1}{2}
$$

Thus, $g(x) \leqslant-\frac{n-1}{2}$. Therefore, the range of $a$ is $a \in\left(-\frac{n-1}{2},+\infty\right)$
(2) $2 f(x)<f(2 x) \Leftrightarrow 2 \lg \frac{1+2^{x}+\cdots+(n-1)^{x}+n^{x} a}{n}$
$$
\begin{array}{l}
<\lg \frac{1+2^{2 x}+\cdots+(n-1)^{2 x}+n^{2 x} \cdot a}{n} \Leftrightarrow\left(\frac{1+2^{x}+\cdots+(n-1)^{x}+n^{x} \cdot a}{n}\right)^{2} \\
<\frac{1+2^{2 x}+\cdots+(n-1)^{2 x}+n^{2 x} \cdot a}{n}
\end{array}
$$

By the Cauchy-Schwarz inequality, we have
$$
\left(1+2^{x}+\cdots+n^{x} \cdot a\right)^{2} \leqslant n\left(1+2^{2 x}+\cdots+n^{2 x} \cdot a^{2}\right)
$$

Since $a \in(0,1], x \neq 0$, the equality cannot be achieved, and $n^{2 x} \cdot a^{2} \leqslant n^{2 x} \cdot a$, hence the inequality * holds.