TITLE: Multiple variables calculus: condition for $f$ to be continuous using curves
QUESTION [5 upvotes]: Prove $f:\mathbb{R}^n\to\mathbb{R}$ is continuous iff for every curve, $\gamma:[a,b]\to\mathbb{R}^n: f\circ \gamma :\mathbb{R}\to\mathbb{R}$ is continuous. 

$(\Rightarrow)$ is trivial.
$(\Leftarrow)$: Intuitively, $f$ is continuous at every subset on it's domain, so all in all $f$ is continuous. 
How to formalize this? What should I rely on?
Thanks.

REPLY [3 votes]: Let's try this.  Suppose $f$ is not continuous at $x=a$. Then there is an $\epsilon>0$ such that for every $n\in\Bbb Z_+$ there is a point $x_n$ such $|x_n-a|< \frac{1}{n} $ and $|f(x_n)-f(a)|\ge \epsilon$. Now, let $\gamma_n$ be a parametrized line from $x_{n}$ to $x_{n+1}$.
Now, we can "string" the $\gamma_n$ together to create a path $\gamma$ such that $f\circ\gamma$ that is not continuous.