I have some trouble understanding this apparently simple concept. Let's say we have to do a minimization of an integral and I need to find L* $$ L^{*} = \min_{z(x)} \int f(x,z(x)) dx$$
Can I bring the min inside and thus write:
$$ L^{*} = \int \min_{z(x)} f(x,z(x)) dx$$
If so, why? Intuitively make sense, but I can't really see the mathematical reason behind.
No, you cannot do this. Let's look at a simpler example, where you're minimizing over a real number rather than a function:
$$\min_a \int_0^1 (x-a)^2\,dx.$$
Here you need to pick a single value of a for which the integral is minimized; the best you can do is $a=\frac{1}{2}$, which gives a value of $\frac{1}{12}$.
Now if the minimimum is on the inside,
$$\int_0^1 \min_a\ (x-a)^2\,dx,$$
you are allowed to pick a different $a$ for every $x$ and can do much better than the single-$a$ case. In particular, you can just pick $a=x$ for every $x$, giving the integral a value of zero.