Find the range of $f(x)=\frac1{1-2\sin x}$ Question:

Find the range for $f(x)= 1/(1-2\sin x)$

Answer :

$ 1-2\sin x \ne 0 $ 
$ \sin x \ne 1/2 $

My approach:

For range : 
$ -1 ≤ \sin x ≤ 1 $ 
$ -1 ≤ \sin x < 1/2$   and   $1/2<\sin x≤1 $  , because $\sin x≠1/2$ 
$ -2 ≤ 2\sin x <1 $ and $ 1< 2\sin x≤2 $ 
$ -1 < -2\sin x ≤2 $ and $ -2≤ -2\sin x<-1 $ 
$ 0 < 1-2\sin x ≤3   $ and $ -1≤ 1-2\sin x<0 $ 

I am stuck at the last step. If I take reciprocal i.e., $\frac 1{1-2\sin x}$ I get :
$ \frac10 < \frac1{1-2\sin x} ≤\frac13   $ and $ -1≤ \frac1{1-2\sin x} < \frac 10 $ 
$1/0$ can be interpreted as infinity so the second equation gives range of $f(x)$ as $[-1,∞)$. But the correct answer is : $(−∞,−1]∪[\frac13,∞)$
Any alternative solutions are welcome :)
P.S. : Also $\frac1{1-2\cos x}$ will also have the same range, right? As $\sin x$ and $\cos x$ both lie between $[-1,1]$. So the answer will proceed in similar fashion to the given one.

You made an error when you took reciprocals.  When $a, b$ have the same sign, $$a < b \implies \frac{1}{a} > \frac{1}{b}$$
You failed to reverse the direction of the inequalities when you took reciprocals.
Since the denominator cannot be zero, you correctly concluded that the function is defined for those real numbers $x$ such that $\sin x \neq \dfrac{1}{2}$.
Since $-1 \leq \sin x \leq 1$ and $\sin x \neq \dfrac{1}{2}$, $-1 \leq \sin x < 1/2$ or $1/2 \leq \sin x \leq 1$.  Note the use of the word or since those two inequalities cannot simultaneously be true.
Let's consider the inequality $-1 \leq \sin x < \dfrac{1}{2}$.
\begin{align*}
-1 \leq & \sin x < \frac{1}{2}\\
-2 \leq & 2\sin x < 1\\
2 \geq & -2\sin x > -1\\
3 \geq & 1 - 2\sin x > 0
\end{align*}
If $a, b > 0$, then $a < b \implies \dfrac{1}{a} > \dfrac{1}{b}$.  To see this, observe that
$$\frac{1}{a} - \frac{1}{b} = \frac{b - a}{ab} > 0$$
since $b - a > 0$ by definition of $a < b$ and $ab > 0$ since the product of positive numbers is positive.  Thus, when you took reciprocals, you should have obtained
$$\frac{1}{3} \leq \frac{1}{1 - 2\sin x}$$
Now, let's consider the inequality $\dfrac{1}{2} < \sin x \leq 1$.
\begin{align*}
\frac{1}{2} & < \sin x \leq 1\\
1 & < 2\sin x \leq 2\\
-1 & > -2\sin x \geq -2\\
0 & > 1 - 2\sin x \geq -1
\end{align*}
If $a, b < 0$, then $a < b \implies \dfrac{1}{a} > \dfrac{1}{b}$.  The proof is identical to that given above for positive numbers except that $ab > 0$ since the product of two negative numbers is positive.  Hence, when you took reciprocals, you should have obtained
$$\frac{1}{1 - 2\sin x} \leq -1$$
Since $\dfrac{1}{3} \leq \dfrac{1}{1 - 2\sin x}$ or $\dfrac{1}{1 - 2\sin x} \leq -1$, the range of the function $f(x) = \dfrac{1}{1 - 2\sin x}$ defined on all real numbers except those for which $\sin x = 1/2$ is
$$(-\infty, -1] \cup \left[\frac{1}{3}, \infty\right)$$
