Minimize smooth real valued function along compact fibres of a smooth fibration Let $M$ be a smooth manifold, and let $\pi:E\to M $ be a smooth fibration with compact fibres. Let $\tau :E \to \mathbb R$ be a smooth function. Denote by $\min \tau : M\to \mathbb R$ the function which sends $p\in M$ to the minimum of $\tau $ restricted to the compact fibre $E_p $. My question is: is it true that, for every $p\in M$, there exists a local smooth section $\gamma: U \to E$ in a neighborhood $U$ of $p$ such that, for every $q \in U$, $\gamma (q) $ realizes the minimum of $\tau_{|E_q}$, i.e. $\pi \circ \gamma =\min \tau $ ?
Thank you
 A: No such section exists in general. The reason is that there might be two (or more) local minima and a sudden change in which one is the global minimum.
For instance, consider the bundle $\pi : \mathbb{R}^2 \to \mathbb{R} : (x,y) \mapsto x$. Let $\tau : \mathbb{R}^2 \to \mathbb{R}$ be given by $\tau(x,y) = -e^{-(x-1)^2 -(y-1)^2} - e^{-(x+1)^2 -(y+1)^2}$. For any given $x$, the local minima are at $y = \pm 1$. If $x \le 0$, then there is a global minimum at $y=-1$; If $x \ge 0$, then there is a global minimum at $y=1$. Any section $\mathrm{min} \, \tau$ defined in a neighborhood of $x = 0$ is discontinuous.
Note that the above $\tau$ (and all of its derivatives) vanishes at infinity. Precompose $\tau$ with any diffeomorphism $\phi : (-\epsilon, \epsilon)^2 \to \mathbb{R}^2$, for instance $\phi(x,y) = \tan(\pi x/2\epsilon) \tan(\pi y/2 \epsilon)$. Then, any time you see in a fiber bundle an open set $S$ diffeomorphic to $(-\epsilon, \epsilon)^2$ by a map $\psi : S \to (-\epsilon, \epsilon)^2$ which is compatible with the fibration (in the sense that each fiber of $\pi$ intersects $S$ in a set of the form $\psi^{-1}[\{p\} \times (-\epsilon, \epsilon)]$) , you can consider the function $\tau_S := \tau \circ \phi \circ \psi$ and smoothly extend it by $0$ outside $S$. Hence you get a counter-example on any rank 1 fiber bundle over a one-dimensional manifold. It is easy to modify this argument to higher rank bundles over higher dimensional manifolds.

You ask in a comment about possible conditions on the fiber bundle or on the function $\tau$ to assure that a local section $\mathrm{min} \, \tau$ exists everywhere (of course, there are topological obstructions to the existence of any globally defined section). I think that any such condition would be rather subtle or very crude.
Suppose a given $\tau$ admits locally a smooth section $\mathrm{min} \, \tau$. Since this section determines an embedded submanifold, there exists a tubular neighborhood $S$ like above. So you can add to $\tau$ the function $\lambda \tau_S$ where $\lambda > 0$ is any small number (we suppose here that $\tau_S$ is $0$ outside $S$). This new section, which can be as close to $\tau$ as we wish in any given $C^{k}$-topology ($k < \infty$ to be safe). If $S$ and $\lambda$ were well chosen (I think such a choice is always possible), this new section does not have a locally defined 'minimum section'. In conclusion, any 'good' section $\tau$ can be very slightly perturbed to a 'bad' section.
So, any condition on $\tau$ should be global. One possible condition would be that $\tau$ has a unique global minimum in each fiber. (I think there is a result which assures that a local minimum (in a smooth family) locally persists and moves smoothly. Such a result might ask for some condition on the minimum, like it being nondegenerate, I am not sure.) This condition is not necessary, as there could be several 'disjoint' global minima (like in a periodic function), but it is probably the simplest to state and to check.
