Identify where $ f(x)= \sqrt{\frac{1-x}{|x|}}$ is continuous

So I am trying to identify where $\sqrt{\frac{1-x}{|x|}}$ and I want some assistance if my my reasoning is right.

$$f(x) = \begin{cases} \sqrt{\frac{1-x}{x}} ,& x \geq 0 \\ \sqrt{\frac{1-x}{-x}}\ ,& x < 0 \\ \end{cases} $$ We know $x\neq0$. We also know that $f(a)$ needs to defined and $f(a) =\lim_{x\to a} f(x) $.

I let $a=2$ therefore $f(a) > 0$ however if you plug $f(a)$ in, it will give a negative root therefore $f(a)$ does not exist and therefore it is not continuous

Now, if $b=-2$ and since $b<0$, we use $f(x)= \sqrt{\frac{1-x}{-x}}$. Thus, when we plug $f(b)$ which gives use a defined number $f(b)\approx 1.2246$.

If we plug in the limit, $f(b) =\lim_{x\to b} f(x) $, it will still give us $1.224$.

Therefore, since limit exists and the limit equals to the $f(b)$, I can deduce that $\sqrt{\frac{1-x}{|x|}}$ is only continuous if $x<0$.

Is my mathematical reasoning correct in this case? Thanks


To begin with, the expression has to be well defined. This means that: \begin{align*} \frac{1-x}{|x|} \geq 0 & \Longleftrightarrow \begin{cases} 1 - x \geq 0\\\\ x \neq 0 \end{cases}\\\\ & \Longleftrightarrow \begin{cases} x\leq 1\\\\ x\neq 0 \end{cases} \end{align*}

Hence the domain of the proposed function is given by $D = (-\infty,0)\cup(0,1]$.

Within such domain, the function $f(x) = 1 - x$ is continuous as well as $g(x) = |x|$.

Therefore the quotient is also continuous.

Since the square root function is continuous and the composition of continuous functions is continuous, we can conclude that the proposed function is continuous as well.

Hopefully this helps!