If $m$ and $n$ have the same prime factors, $p_1, ....... , p_k$ then
$m = \prod p_i^{a_i}$ for some set of positive integers $a_1, .... , a_k$ and $n = \prod p_i^{b_i}$ for some set of positive integers $b_1,...., b_k$.
The $\phi(m) = \prod (p_i - 1) \prod p_i^{a-1}$ and $\phi(n) = \prod (p_i - 1) \prod p_i^{b_i-1}$.
And $n\phi(m) = \prod p_i^{b_i}\prod (p_i - 1) \prod p_i^{a_i-1}=\prod (p_i - 1)\prod p_i^{a_i+b_i-1}$ and $m\phi(n) = \prod p_i^{a_i}\prod (p_i - 1) \prod p_i^{b_i-1}=\prod (p_i - 1)\prod p_i^{a_i+b_i-1}$.
So $m\phi(n) = n\phi(m)$
But notice that this may or may not be an if and only if statement.
You've only been asked to prove one direction.