# If $S\subset \mathbb{R}^n$ is path connected and $f:S\to \mathbb{R}^m$ has path-connected graph then $f$ is continuous

I was reading the following topic:

If the graph $G(f)$ of $f : [a, b] \rightarrow \mathbb{R}$ is path-connected, then $f$ is continuous.

And I was wondering whether it can be generalized. Since the proof given by Nate Eldredge makes use of the Intermediate Value Theorem, there is (I think) no obvious way to generalize the theorem when $f$ is defined on a set which is more than one-dimensional.

My question is: if the graph of the function $f:S\to \mathbb{R}^m$ where $S\subset \mathbb{R}^n$ is a path connected subset, is it necessarily true that $f$ is continuous?

Consider $f:\Bbb R^2\to \Bbb R^3$ given by: $$f(x,y)= \begin{cases} 0 & x<0 \\ x & x\ge0,\, y\ge 0\\ -x & x\ge 0,\, y<0 \end{cases}$$ Then $G(f)$ is path connected. But $f$ is discontinuous at every $(x,y)$ where $x>0, y=0$.