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.
 A: 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.
A: Take $m=n=1$ and $f(x)=x^3$ as a map from the reals to the reals. It maps convex sets (i.e. intervals in this case) to convex sets, and also its inverse function $f^{-1}$ does this. But it is not affine. [Note also the image of $f$ is all of $\mathbb{R}$ so is a subspace.]
Added: A (perhaps trivial) example in the case $n=m=2$ can be done with the map $F(x,y)=(x^3,0).$ If $P=(a,b),\  Q=(c,d)$ where $a \le c$ then $F$ maps the segment $PQ$ to the vertical segment $[a^3,b^3] \times \{0\},$ which is convex, while $F^{-1}$ maps segment $PQ$ to the strip $[a^{1/3},b^{1/3}] \times \mathbb{R},$ which is again convex. Note also that here $F(\mathbb{R}^2)$ is the $x$ axis, a subspace of $\mathbb{R}^2.$ This $F$ is not affine.
