Prove that $M_i \leq M_i'M_i''$ and $m_i \geq m_i'm_i''$ 
Suppose $f$ and $g$ are integrable on $[a,b]$ and $g(x) \geq 0$ for all $x$ in $[a,b]$. Let $\mathcal{P}$ be a partition of $[a,b]$. Let $M_i'$ and $m_i'$ denote the appropriate $\sup$'s and $\inf$'s for $f$. Define $M_i''$ and $m_i''$ similarly for $g$, and $M_i$ and $m_i$ similarly for $fg$. Prove that $M_i \leq M_i'M_i''$ and $m_i \geq m_i'm_i''$.

To prove the first inequality, i.e. $M_i \leq M_i'M_i''$, we note that this is equivalent to $$\sup{fg} \geq \sup{f}\sup{g}.$$ I am not sure how to prove this statement, but I think using the fact that $g(x) \geq 0$ will help. Similarly with the second statement.
 A: This is only true if $f(x) \geqslant 0$ as well.
For example, if $-4 \leqslant f(x) \leqslant -2$ and $1 \leqslant g(x) \leqslant 3,$ then $-12 \leqslant f(x)g(x) \leqslant-2.$ In this case $M_i \leqslant M_i'm_i''$ and $m_i \geqslant m_i'M_i''.$
Consider some subinterval $I_i$.
For all $x \in I_i$ we have
$$f(x) \leqslant \sup_{x \in I_i}f(x) = M_i', \\ 0 \leqslant g(x) \leqslant \sup_{x \in I_i}g(x) = M_i''.$$
Hence, since $M_i''\geqslant 0$ and $M_i'' = 0$ if and only if $g(x) = 0$ for all $x \in I_i,$ we have
$$f(x)g(x) \leqslant M_i'M_i''.$$
As you observed, we need $g(x) \geqslant  0$ to ensure that the inequality is not reversed upon multiplication by $g(x)$ and $M_i''$.  
Since $M_i'M_i''$ is an upper bound for $f(x)g(x)$ on $I_i$ it must be no smaller than the supremum (least upper bound).  
Therefore,
$$M_i = \sup_{x \in I_i}f(x)g(x) \leqslant M_i'M_i''.$$
Proving $m_i \geqslant m_i'm_i''$ is carried out in a similar way. It would be a good exercise for you to attempt this yourself. The hypothesis that $g(x) \geqslant 0$ will again be necessary. Since $0$ is a lower bound we can argue that the infimum (greatest lower bound) must be no smaller than $0$, that is $m_i'' \geqslant 0$, and multiplying by $g(x)$ and $m_i''$ does not reverse an inequality.
