REVISED ANSWER:
Lemma 1. If $f$ is not convex, then we can find a random variable $X$ such that $\mu (f(X)) - f(\mu (X)) < m(f(X)) - f(m(X))$.
Proof. If $f$ is not convex, then, by definition, there exist two points $a \neq b$ and a $p \in (0,1)$ such that $f(pa + (1-p)b) > pf(a) + (1-p)f(b)$. If this inequality holds for $p = 1/2$ but not for $p = 3/4$, then it also holds with $p = 2/3$ and $a$ replaced by $3a/4 + b/4$. Thus, WLOG we can assume that $f(pa + (1-p)b) > pf(a) + (1-p)f(b)$ for some $a \neq b$ and $p > 1/2$. Define random variable $X$ as follows: ${\rm P}(X = a) = p$, ${\rm P}(X = b) = 1-p$. Then, $m(X) = a$ and $m(f(X)) = f(a)$, so $m(f(X)) - f(m(X)) = 0$. The lemma now follows from $\mu (f(X)) - f(\mu (X)) = pf(a) + (1-p)f(b) - f(pa + (1-p)b) < 0$.
Lemma 2. If for some $a < b < c$, $f(a) = f(c) > f(b)$, then we can find a random variable $X$ such that $\mu (f(X)) - f(\mu (X)) < m(f(X)) - f(m(X))$.
Proof. Fix $\varepsilon > 0$ sufficiently small. Define random variable $X$ as follows: ${\rm P}(X=b) = 1/2 - \varepsilon$, ${\rm P}(X=a) = (1/2 + \varepsilon)(c - b)/(c - a)$, ${\rm P}(X=c) = (1/2 + \varepsilon)(b - a)/(c - a)$. Then, $\mu(X)=m(X)=b$, and ${\rm P}[f(X) = f(b)] = 1/2 - \varepsilon$, ${\rm P}[f(X) = f(a)]= 1/2 + \varepsilon$. The lemma now follows from $\mu(f(X)) = (1/2 - \varepsilon)f(b) + (1/2 + \varepsilon)f(a) < f(a) = m(f(X))$.
From Lemmas 1 and 2, we conclude:
Corollary. The inequality $\mu (f(X)) - f(\mu (X)) \geq m(f(X)) - f(m(X))$ holds for any (integrable) random variable $X$ only if $f$ is convex and monotone.
EDIT: A somewhat trivial extension of this corollary ("if part").
Suppose that $f$ is a strictly monotone convex function, defined on an interval $I$ containing the range of an integrable rv $X$. If $m(X)$ is unique, then so is $m(f(X))$, and it holds $\mu (f(X)) - f(\mu (X)) \geq m(f(X)) - f(m(X)) = 0$.
Proof. By Jensen's inequality, $\mu (f(X)) - f(\mu (X)) \geq 0$. So, it remains to show that $m(f(X)) = f(m(X))$. Suppose that $\tilde m \in f(I)$ is a median of $f(X)$. Then, by definition, ${\rm P}(f(X) \leq \tilde m) \geq 1/2$ and ${\rm P}(f(X) \geq \tilde m) \geq 1/2$. Taking inverses shows that $f^{-1}(\tilde m)$ is a median of $X$. Thus, $f^{-1}(\tilde m) = m(X)$, and the assertion follows.