7. Let $f(x)=\frac{1010 x+1009}{1009 x+1010}$, define:
$$
\begin{array}{l}
f^{(1)}(x)=f(x), \\
f^{(i)}(x)=f\left(f^{(i-1)}(x)\right)(i=2,3, \cdots) .
\end{array}
$$

Then $f^{(n)}(x)=$ $\qquad$ .
7. $\frac{\left(2019^{n}+1\right) x+2019^{n}-1}{\left(2019^{n}-1\right) x+2019^{n}+1}$.

From the given, we have
$$
\begin{array}{l}
f^{(n)}(x)=\frac{1010 f^{(n-1)}(x)+1009}{1009 f^{(n-1)}(x)+1010} \\
\Rightarrow \frac{f^{(n)}(x)-1}{f^{(n)}(x)+1}=\frac{1}{2019} \cdot \frac{f^{(n-1)}(x)-1}{f^{(n-1)}(x)+1} .
\end{array}
$$

By induction, we get
$$
\begin{array}{l}
\frac{f^{(n)}(x)-1}{f^{(n)}(x)+1}=\frac{1}{2019^{n}} \cdot \frac{x-1}{x+1} \\
\Rightarrow f^{(n)}(x)=\frac{\left(2019^{n}+1\right) x+2019^{n}-1}{\left(2019^{n}-1\right) x+2019^{n}+1} .
\end{array}
$$