Functions mapping convex sets on convex sets A function $f:\Bbb R^n\to\Bbb R^m$ is said that maps convex sets on convex sets if it satisfies: (1) the image $f(A)$ of any convex set $A$ is a convex set; (2) the preimage $f^{-1}(B)$ of any convex set $B$ is a convex set. All affine transformations are examples of such functions.
My question is the following: if $f:\Bbb R^n\to\Bbb R^m$ maps convex sets on convex sets and $f(\Bbb R^n)$ is a subspace of $\Bbb R^m$, is $f$ an affine transformation?
Thanks for your help.
Addendum: I'm interested in the case $n,m>1$. I apologize for not specifying this before.

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. 

So the answer is YES.
