To find the minimum value of \( f(x, y, z) \), we take the partial derivatives with respect to \( x \), \( y \), and \( z \) and set them equal to zero.
The partial derivatives are:
\[
\frac{\partial f}{\partial x} = 2x - 4, \quad \frac{\partial f}{\partial y} = 10y + 40, \quad \frac{\partial f}{\partial z} = 10z - 40
\]
Setting these equal to zero:
\[
2x - 4 = 0 \implies x = 2
\]
\[
10y + 40 = 0 \implies y = -4
\]
\[
10z - 40 = 0 \implies z = 4
\]
Now, substitute \( x = 2 \), \( y = -4 \), and \( z = 4 \) into the original function \( f(x, y, z) \):
\[
f(2, -4, 4) = (2)^2 + 5(-4)^2 + 5(4)^2 - 4(2) + 40(-4) - 40(4) + 300
\]
\[
= 4 + 5(16) + 5(16) - 8 - 160 - 160 + 300
\]
\[
= 4 + 80 + 80 - 8 - 160 - 160 + 300 = 136
\]
Thus, the minimum value of the function is \( \boxed{136} \).