Is the function T $\mathbb R$-linear?

Such map $T$ is not necessarily $\mathbb{R}$-linear. To see that consider the following counterexample.

Let $\pi_x : \mathbb{R}^2 \to \mathbb{R} : (x, y) \mapsto x$ the $x$-coordinate projection in $\mathbb{R}$, $e_x : \mathbb{R} \to \mathbb{R}^2 : x \mapsto (x, 0) $ the "canonical embedding" of the $x$-coordinate in $\mathbb{R}^2$, $$ f : \mathbb{R} \to \mathbb{R} : x \mapsto \begin{cases} \sin(\frac{1}{x}) &,& x \neq 0 \\ \hfill 0 \hfil &,& x = 0 \end{cases} $$ and $$ T : \mathbb{R}^2 \to \mathbb{R}^2 : (x, y) \mapsto e_x \circ f \circ \pi_x(x,y) = (f(x), 0 )$$

By definition, $T(0,0) = (0,0)$.

Now let $C \subseteq \mathbb{R}^2$ convex. Then $\pi_x(C) \subseteq \mathbb{R}$ is convex.

Since convex sets of $\mathbb{R}$ are intervals and $f$ maps intervals to intervals, it follows that $f \circ \pi_x(C) \subseteq \mathbb{R}$ is convex.

Therefore $ T(C) = e_x \circ f \circ \pi_x(C) \subseteq \mathbb{R}^2 $ is convex.

But $T$ is clearly not $\mathbb{R}$-linear.


In the book Computational and Analytical Mathematics, Springer 2013, Knecht and Vanderwerff prove in Theorem 21.3 on page 458ff the following:

Let $X$ and $Y$ be any Banach spaces where $X$ contains two linearly independent vectors. Suppose $T:X\to Y$ is a continuous and one-to-one mapping such that $T$ maps convex sets on convex sets. Then $T$ is affine.

Now your $T$ is actually linear because $T(0)=0$. So the answer is YES provided that $T$ is one-to-one and continuous. Note that assuming one-to-one is reasonable, else you could just send everything to the zero vector.