The given data is:
Let the midpoint of each class interval be:
\[
\text{Midpoints:} \quad 5, 15, 25, 35, 45.
\]
Now, calculate the sum of the products of the midpoints and the corresponding frequencies. The formula for the mean is:
\[
\text{Mean} = \frac{\sum f x}{\sum f},
\]
where \( f \) is the frequency and \( x \) is the midpoint of the class interval. We know the mean is 25, so:
\[
25 = \frac{6 \times 5 + f \times 15 + 6 \times 25 + 10 \times 35 + 5 \times 45}{6 + f + 6 + 10 + 5}.
\]
Simplify:
\[
25 = \frac{30 + 15f + 150 + 350 + 225}{27 + f}.
\]
\[
25 = \frac{755 + 15f}{27 + f}.
\]
Now multiply both sides by \( 27 + f \):
\[
25(27 + f) = 755 + 15f.
\]
Simplify:
\[
675 + 25f = 755 + 15f.
\]
Now, solve for \( f \):
\[
25f - 15f = 755 - 675,
\]
\[
10f = 80 \quad \Rightarrow \quad f = 8.
\]
Conclusion:
The value of \( f \) is 8.