# Proving continuity of a piece-wise function

I want to prove the function $$f(x)=$$ $$\begin{cases} \frac{1-\sqrt{1+ax^2}}{x^2}, & x \ne 0\\ a, & x=0 \end{cases}$$

( where $$a \in \Bbb{R}$$ ) is continuous in its domain. To begin with, $$f$$ is continuous on an interval if it is continuous at every point of that interval, in this case the interval $$[-\infty ,\infty ]$$. Lets first look at the value of $$f$$ when $$x \neq 0$$ :

$$f(x) = \frac{1-\sqrt{1+ax^2}}{x^2}$$

Lets assume there exists functions $$g$$ and $$h$$, such that $$g(x)=1-\sqrt{1+ax^2}$$ and $$h(x) = x^2$$. Now $$f$$ is continuous at $$\Bbb{R}$$\ $$0$$, if $$g$$ and $$h$$ are continuous there as well. And they are, since $$g$$ and $$h$$ are continuous everywhere in their domain. Therefore $$f(x)$$ is continuous on the interval $$\Bbb{R}$$\ $$0$$.

In the case where $$x=0$$, we can say $$f$$ is continuous there if the limit $$\lim_{x\to 0}f(x)=f(0)=f(a)$$ Which is true by the definition of $$f$$. Is this enough to show $$f$$ is continuous in its domain?

You must show that both limits $$\lim_{x\to 0^{+}}\frac{1-\sqrt{1+ax^{2}}}{x^{2}} \quad \mbox{and} \quad \lim_{x\to 0^{-}}\frac{1-\sqrt{1+ax^{2}}}{x^{2}}$$ are equal to $$f(0) = a$$. Note, however, that this function depends only on $$x^{2}$$ so it is enough to consider only one limit. But using L'Hospital, it is easy to conclude that: $$\lim_{x\to 0}\frac{1-\sqrt{1+ax^{2}}}{x^{2}} = -\frac{a}{2} \neq a = f(0)$$ so the function is not continuous at $$x=0$$.
$$\lim_{x\to 0}\frac{1-\sqrt{1+ax^2}}{x^2}= \lim_{x\to 0}\frac{-ax^2}{x^2(1+\sqrt{1+ax^2})} = -{a\over 2}$$
So your function is not continous at $$x=0$$ if $$a\ne 0$$.