Continuity of $\arg (z)$

Let $\mathrm{arg}:\mathbb{C}\setminus \{0\} \to [0,2\pi)$ be the function with $\mathrm{arg}(re^{i\alpha})= \alpha$ and $\alpha \in [0,2\pi)$. How can we prove that $\mathrm{arg}: \mathbb{C}\setminus A \to \mathbb{R}$ is continuous when $A= \{z\in \mathbb{C} | x \geq 0, y=0\}$?

Solutions Collecting From Web of "Continuity of $\arg (z)$"

Here’s another perspective using the definition of continuity. First we need to define some variables.

Let $0 < \epsilon < \pi/2$ be given. Take any complex number $z = r e^{i \theta} \notin A$ and take $\delta > 0$ small enough so that $B_\delta(z) \cap A = \emptyset$ (i.e. so that the $\delta$-ball centered at $z$ does not intersect the ray $A$). Define $\phi$ to be half of the angle subtended by $B_\delta(z)$ at the origin.

We should now have a picture like this.

For any $w \in B_\delta(z)$ we have

$$0 \leq \theta – \phi \leq \operatorname{Arg}(w) \leq \theta + \phi \leq 2\pi.$$

By the law of sines we see that $\phi = \arcsin(\delta/r)$. It follows that if $\delta < r \sin \epsilon$ then

$$|\operatorname{Arg}(w) – \theta| < \epsilon.$$

We conclude that $\operatorname{Arg}$ is continuous on $\mathbb C \setminus A$.

To see that it is not continuous on $A$, note that in any open set intersecting $A$ one can find complex numbers arbitrarily close to each other such that one number has argument $0$ and the other has argument arbitrarily close to $2 \pi$.

Note that
\begin{align} \frac{\sin(\theta)}{1-\cos(\theta)} &=\frac{2\sin(\theta/2)\cos(\theta/2)}{2\sin^2(\theta/2)}\\[6pt] &=\cot(\theta/2)\\[12pt] &=\tan((\pi-\theta)/2)\tag{1} \end{align}
Using $(1)$, $\sin(\theta)=\frac{y}{\sqrt{x^2+y^2}}$, and $\cos(\theta)=\frac{x}{\sqrt{x^2+y^2}}$, we get that
\begin{align} \arg(x+iy) &=\theta\\ &=\pi-2\arctan\left(\frac{y}{\sqrt{x^2+y^2}-x}\right)\tag{2} \end{align}
which is continuous for all $\mathbb{C}$ away from the positive real axis (the positive real axis is precisely where $\sqrt{x^2+y^2}-x=0$).