Function which preserves closed-boundedness and path-connectedness continuous?

Let $f:\mathbb{R^n}\to\mathbb{R^m}$ be a function such that the image of any closed bounded set is closed and bounded, and the image of any path-connected set is path-connected. Must $f$ be continuous? What if we replace "path-connected" with "connected"?

-

For both "path-connected" and "connected" cases, $f$ must be continuous.
By reduction to absurdity, assume that $f$ is discontinous as some point $x\in\mathbb{R}^n$. since $f$ maps compact sets to compact sets, we can find a sequence $\{x_k:k\ge 1\}\subset \mathbb{R}^n$ with $\lim_{k\to\infty}x_k=x$, such that for the sequence $\{y_k:=f(x_k):k\ge 1\}\subset\mathbb{R}^m$, $y:=\lim_{k\to\infty}y_k$ exists and $y\ne f(x)$. By choosing a subsequence of $\{x_k\}$ if necessary, we only need to consider two special cases: (i) $y_k=y$ for every $k$; (ii) $y_k\ne y$ for every $k$.
For case (i), let $L_k$ be the line segment joining $x_k$ and $x$, then by either "path-connected" or "connected" assumption, $f(L_k)$ is connected and $\{y,f(x)\}\subset f(L_k)$. Then for each $k$, we can replace $x_k$ with some $x_k'\in L_k$, such that $y_k':=f(x_k')\ne y$ but $\lim_{k\to\infty}y_k'=y$. Since $\lim_{k\to\infty}x_k'=x$, we have reduced case (i) to case (ii).
For case (ii), the set $\{x_k:k\ge 1\}\cup\{x\}$ is compact, but its image under $f$ is $\{y_k:k\ge 1\}\cup\{f(x)\}$, which is noncompact, a contradiction.