Q:

When can the Minkowski metric be treated as a "number"?

I am starting to study QED at the moment. I can not wrap my head around why the metric ($g_{\mu\nu}$) is used as a number sometimes.
In this case it is pretty obvious that it has to be the number since the trace of a matrix is a scalar.
$$\operatorname{tr}(\gamma^\mu\gamma^\nu\gamma^\lambda\gamma^\sigma)=4(g^{\mu\nu}g^{\lambda\sigma}-g^{\mu\lambda}g^{\nu\sigma}+g^{\mu\sigma}g^{\nu\lambda})$$
I know how to proof this but I do not understand why the metric is a number in this case? I would be really happy if somebody could enlighten me.

A:

It's a bit of useful notational sloppiness that we call $g_{\mu \nu}$ the metric.  The tensor ${\bf{g}}$ is the metric; $g_{\mu \nu}$ are the components of the metric in some unspecified basis, and as such are always numbers.  
Unfortunately, when it comes to pretty much any actual computations, it's way more convenient to work with the components of the various geometric objects than to lug around the objects themselves.  This can be tricky until you have a good handle on precisely what it is that you're doing.
Here's an example.  Consider a vector basis $\{\hat e_1,\hat e_2,\ldots,\hat e_n\}$.  A covector is a linear map which eats vectors and spits out real numbers; it has a canonical covector basis $\{\hat\epsilon^1,\hat\epsilon^2,\ldots,\hat\epsilon^n\}$ defined by the property that $\hat\epsilon^i(\hat e_j) = \delta^i_{\ j}$.  
Any vector can be expanded in this basis:
$$ {\bf{X}} = X^\mu \hat e_\mu$$
where the $X^\mu$'s are the components of ${\bf{X}}$ in the chosen basis (i.e. they are numbers).  We can pick out the $\nu$ component by feeding it to the covector $\hat \epsilon ^\nu$:
$$\hat \epsilon^\nu({\bf{X}}) = \hat \epsilon^\nu(X^\mu \hat e_\mu) = X^\mu \hat \epsilon^\nu(\hat e_\mu) = X^\mu \delta^\nu_\mu = X^\nu $$
where we pulled the $X^\mu$ outside because it's just a number, and covectors are linear maps.
In the same way, we can expand covectors in their basis
$${\bf{\omega}} = \omega_\mu \hat \epsilon^\mu$$
and pick out the components by feeding them the vector basis:
$${\bf{\omega}}(\hat e_\nu) = \omega_\nu $$

If we have a metric tensor ${\bf{g}}$ (which eats two vectors and spits out a real number), then we can take any vector ${\bf{X}}$ and map it to its covector dual ${\bf{\tilde X}}$ like this:
$$ {\bf{\tilde X}} := {\bf{g}}({\bf{X}},\bullet)$$
where the bullet denotes an "empty slot."  When the covector ${\bf{\tilde X}}$ acts on a vector $\bf Y$, this is the result:
$$ {\bf{\tilde X}}({\bf{Y}}) := {\bf{g}}({\bf{X}},{\bf{Y}}) = {\bf{g}}(X^\mu\hat e_\mu,Y^\nu \hat e_\nu) = X^\mu Y^\nu {\bf{g}}(\hat e_\nu, \hat e_\mu) \equiv X^\mu Y^\nu g_{\mu \nu}$$
where ${\bf{g}}(\hat e_\mu,\hat e_\nu) = g_{\mu \nu}$ by definition.
It therefore follows that
$$\tilde X_{\nu} = {\bf{\tilde X}}(\hat e_\nu) = {\bf{g}}({\bf{X}},\hat e_\nu) = {\bf{g}}(X^\mu \hat e_\mu,\hat e_\nu) = X^\mu {\bf{g}}(\hat e_\mu,\hat e_\nu) = X^\mu g_{\mu \nu}$$

I'm sure you knew all of that already - the point was to try to make obvious in very simple calculations which quantities were "just numbers" and which were not.

