Only a partial answer, but at least something. I will prove the following statement:

Assume that $X$ and $Y$ are any real vector spaces and that $f:X\to Y$ is so that for any $u,v\in X$ there are $u',v'\in Y$ such that $f(\{u+tv\ |\ t\in\mathbb R\})=\{u'+sv'\ |\ s\in\mathbb R\}$ and $f(0)=0$. Then $f$ satisfies $f(u+qv)=f(u)+qf(v),\ u,v\in X,q\in\mathbb Q$.

The assumption can be rewritten as follows: There are functions $a,b:X\to Y$ and $g:\mathbb R\to\mathbb R$ such that $$f(u+tv)=a(u)+g(t)b(v),\qquad u,v\in X,t\in\mathbb R.$$

We first obtain from \begin{align} 0&=f(0+0\cdot v)=a(0)+g(0)b(v), \\ 0&=f(0+t\cdot 0)=a(0)+g(t)b(0), \\ 0&=f(tv-tv)=a(tv)+g(-t)b(v), \\ 0&=f(tv+t(-v))=a(tv)+g(t)b(-v), \end{align} that \begin{align*} g(0)b(v)&=g(t)b(0), \\ a(tv)&=-g(-t)b(v)=-g(t)b(-v),\qquad v\in X,t\in\mathbb R. \end{align*} Case 1: $g(0)\neq 0:$ Then $b(v)=b(0)$. If $b(0)\neq0$, then $g(t)=g(0)$ and $a(v)=-g(1)b(-v)=-g(0)b(0)$ and $f\equiv0$. If $b(0)=0$, then $a(v)=-g(1)b(-v)=0$ and again $f\equiv0$.

Case 2: $g(0)=0$: Then $a(u)=f(u)$ for all $u\in X$. In particular, \begin{align*} f(u+tv)&=f(u)+g(t)b(v), \\ f(u+v)&=f(u)+g(1)b(v),\qquad u,v\in X,t\in\mathbb R.\tag{1} \end{align*} If $g(1)=0$, then $f(v)=f(0+v)=f(0)=0$ and $f\equiv0$. We therefore assume that $g(1)\neq0$. Then letting $u=0$ in (1) gives $f(v)=g(1)b(v)$. On the other hand, letting $v=-u$ in (1) gives $f(-v)=-g(1)b(v)$ and hence $f(-v)=-f(v)$ and \begin{align} f(u+tv)=f(u)+\tfrac{g(t)}{g(1)} f(v),\qquad u,v\in X,t\in\mathbb R.\tag{2} \end{align} Suppose that $f\not\equiv0$. Then there is some $x\in X$ such that $f(x)\neq0$. From (2) we obtain \begin{align} f((s+t)x)&=\tfrac{g(s+t)}{g(1)}f(x), \\ f((s+t)x)&=f(sx+tx)=f(sx)+\tfrac{g(t)}{g(1)}f(x)=\left(\tfrac{g(s)}{g(1)}+\tfrac{g(t)}{g(1)}\right)f(x) \end{align} and consequently $g(s+t)=g(s)+g(t)$ for all $s,t\in\mathbb R$. Thus, $g(q)=qg(1)$ for all $q\in\mathbb Q$ and $$ f(u+qv)=f(u)+qf(v),\qquad u,v\in X,q\in\mathbb Q. $$