7. Let the function $f(x)=x^{2}-x+1$. Define $f^{(n)}(x)$ as follows:
$$
f^{(1)}(x)=f(x), f^{(n)}(x)=f\left(f^{(n-1)}(x)\right) \text {. }
$$

Let $r_{n}$ be the arithmetic mean of all the roots of $f^{(n)}(x)=0$. Then $r_{2015}=$ $\qquad$
7. $\frac{1}{2}$.

It is easy to see that $f^{(i)}(x)=0$ is a $2^{i}$-degree equation, with $2^{i}$ roots. Below, we prove by mathematical induction that for any $i \in \mathbf{Z}_{+}, r_{i}=\frac{1}{2}$.
When $i=1$, it is easy to see that $r_{1}=\frac{1}{2}$.
Assume the conclusion holds for $i$, and consider the case for $i+1$. Notice that,
$$
f^{(i+1)}(x)=0 \Leftrightarrow f\left(f^{(i)}(x)\right)=0 \text {. }
$$

Let the roots of $f(x)=0$ be $\alpha$ and $\beta$.
Then $f^{(i)}(x)=\alpha$ or $\beta$.
By the induction hypothesis, the sum of the roots of the above two equations is $\frac{1}{2} \times 2^{i}=2^{i-1}$.
Thus, the sum of the roots of $f^{(i+1)}(x)=0$ is $2^{i}$. Therefore, $r_{i+1}=\frac{2^{i}}{2^{i+1}}=\frac{1}{2}$, meaning the conclusion also holds for $i+1$. Hence, for any $i \in \mathbf{Z}_{+}, r_{i}=\frac{1}{2}$. Consequently, $r_{2015}=\frac{1}{2}$.