Let $g: \mathbb{R}^n\setminus\{0\} \to \mathbb{R}$ be a function of class $C^{1}$ and suppose that there is $M > 0$ such that $$\left|\frac{\partial}{\partial x_{i}}g(x)\right| \leq M.$$ Prove that if $n \geq 2$ then $g$ can be extended to a continuous function defined in $\mathbb{R}^n$. Show that if $n = 1$ the statement is false.
My attempt.
I define the extension $\bar{g}: \mathbb{R}^n \to \mathbb{R}$ by $\bar{g}(x) = g(x)$ if $x \in \mathbb{R}^{n}\setminus\{0$} and $\displaystyle \bar{g}(0) = \lim_{x \to 0}g(x)$. Thus $$\lim_{x \to 0} \bar{g}(x) = \lim_{x \to 0}g(x) = \bar{g}(0),$$ so $\bar{g}$ is continuous. So the question is reduced to proving that $\displaystyle \lim_{x \to 0}g(x)$ exists. Thus, I must show that $$\forall \epsilon > 0, \exists \delta > 0\text{ s.t. } \Vert X \Vert < \delta \Longrightarrow |g(x)|<\epsilon.$$
The hypothesis $$\left|\frac{\partial}{\partial x_{i}}g(x)\right| \leq M$$ seems necessary for getting $$|g(x)-g(y)| \leq M|x-y|$$ using the Mean Value Inequality. This almost solves the problem, because if $g(0) = 0$ we can write $$|g(x)| \leq M|x|.$$ But $g(0) = 0$ doesn't make sense. I'm stuck here.
Also, I cannot see why it is necessary that $n \geq 2$, where I use this in the demonstration, and why it fails when $n=1$.
Hint: Suppose $x,y\ne 0.$ Let $L$ be the line through $x$ and $0.$ If $y$ is not on $L,$ then $[x,y]$ does not pass through $0.$ Hence $|f(y)-f(x)|\le M|y-x|$ by the MVI. If $y$ is on $L,$ Choose $y'\ne 0$ close to $y$ but not on $L \,...$