Do not start by fixing a covering ${\bf U}=\{U_i\}_{i\in I}$ of $M$ ! Here is how you might proceed.
For each $m\in M$ choose an open neigbourhood $ U_m$ of $m$ and a constant $\epsilon _m\gt0$ with $\epsilon_m \lt f$ on $ U_m$.
Then choose a partition of unity $(\phi _m)_{m\in M}$ subordinate to the covering $\mathcal U=(U_m)_{m\in M}$.
The map $g=\sum\limits_{m\in M} \epsilon_m \phi _m$ is of class $\mathcal C^\infty$ and satisfies, as required, $0\lt g\lt f$. That's all.
Warning I think the apparent difficulty of this exercise comes from the common misconception that if you have an open covering $(U_i)_{i\in I}$ of a paracompact manifold and you want a subordinate partition of unity $(\phi_i)_{i\in I}$, then you should impose something on the covering, like being locally finite or denumerable, or on the $U_i$'s, like being relatively compact.
This is actually not necessary at all: the $\phi_i$'s always exist, they are $\geq 0$, their supports form a locally finite collection of closed sets $supp(\phi_i)\subset U_i$ [even if the initial covering $(U_i)_{i\in I}$ was $not$ locally finite!] and of course $\sum\limits_{i\in I} \phi_i=1$.
This pleasantly general result is stated and proved correctly in John M. Lee's book, on page 55.