In general the answer is "No". Take any $f\colon\mathbb{R}^n\to\mathbb{R}$ which is linear with respect to $\mathbb{Q}$ but non linear with respect to $\mathbb{R}$. Then there is some real $a'\in(0,1)$ and some $x_0\in\mathbb{R}^n$ such that $f(a' x_0)\not=a' f(x_0)$. We also may assume that $f(a' x_0)>a' f(x_0)$ by possibly using $-x_0$ instead of $x_0$. Then $f$ satisfies $f(ax+by) \leq af(x)+bf(y)$ with equality for $a$ (and also $b$) rational. But, using $b'=1-a'$, $f(a' x_0+b' 0)=f(a'x_0)>a'f(x_0)=a' f(x_0)+b'f(0)$.
Remark: The existence of a mapping $f$ being linear with respect to the field of rationals but not linear with respect to the reals may be proved by using a basis of the vector space $\mathbb{R}^n$ viewed as a rational vector space.