Okay, so I'm finally actually stuck on a question. I don't really have an idea of how to go forward from where I'm stuck. The question is:
Prove that $\lim_{x \to x_0} \tan(x) = \tan(x_0)$, if $x \neq (n+\frac{1}{2})\pi for n \in \mathbb{Z}$.
Proof Attempt:
Let $\epsilon>0$ be given. Then, we need a $\delta>0$ so that:
$$0<|x-x_0| < \delta \implies |\tan(x)-\tan(x_0)| < \epsilon$$
So, we play around with $|\tan(x)-\tan(x_0)|$:
$$|\tan(x)-\tan(x_0)| = |\frac{\sin(x-x_0)}{\cos(x)\cos(x_0)}| \leq \frac{|x-x_0|}{\cos(x)\cos(x_0)} < \frac{\delta}{|\cos(x)\cos(x_0)|}$$
I don't really know where to go from there? Like, I was thinking of letting $\delta = \epsilon \cdot |\cos(x)| \cdot |\cos(x_0)|$ but that would mean that my $\delta$ would depend on $x$. I'm not too sure if that's allowed.
I was also thinking of using, maybe, the continuity of $\cos(x)$ by introducing a separate $\delta$ and taking the minimum of that $\delta$ and another random number but I'm not quite sure how that would help.
I would appreciate if someone could give me a good hint on how to continue. I don't mind a full proof as well but I'm probably not going to look at your proof till I've completely had it with this problem.
Also, I know very well that I can prove this by showing that $\sin(x)$ and $\cos(x)$ are continuous, before showing that the ratio of two continuous functions is, itself, continuous. But I don't want to do it that way, if it's possible.
You have the right idea where you stated
However, you don't need a "random number". Instead, you can use that if the second $\delta$ is small enough, $\cos(x)$ is non-zero over it's entire range. For example, you have, for all integers $n$, that
$$x_0 \neq \left(n + \frac{1}{2}\right)\pi \tag{1}\label{eq1A}$$
This means there exists an integer $n_0$ such that
$$\left(n_0 + \frac{1}{2}\right)\pi \lt x_0 \lt \left((n_0 + 1) + \frac{1}{2}\right)\pi \tag{2}\label{eq2A}$$
Choose the second delta, call it $\delta_2$, so it's a fraction less than $1$ of the minimum of the difference between $x_0$ and $\left(n_0 + \frac{1}{2}\right)\pi$, and that of the difference between $\left((n_0 + 1) + \frac{1}{2}\right)\pi$ and $x_0$. Let's say, rather arbitrarily, this fraction is $\frac{1}{2}$. In this region, then, $\cos(x)$ is not $0$ for any $x \in (x_0 - \delta_2, x_0 + \delta_2)$.
Since you stated you would appreciate just a good hint, I believe this qualifies. Nonetheless, since you also don't mind a full proof, I've provided the rest of the solution below, but put them in spoilers below.
Using this concept, you get
Next, you can reason as follows:
This gives
Thus, continuing your line of inequalities, you then have for $x \in (x_0 - \delta_2, x_0 + \delta_2)$ that
You would then next use the following statement:
You would then have
Of course, there are simpler ways to prove the continuity of $\tan(x)$, such as using that $\sin(x)$ and $\cos(x)$ are continuous, which you've stated yourself, but this shows how you can also do it directly as well.