The principal value of $\tan^{-1}\theta$ is always between $-\frac{\pi}2$ and $\frac{\pi}2$. The principal value of $\arg z$, on the other hand, is always in the interval $(-\pi,\pi]$. Thus, for $z$ in the first quadrant it’s between $0$ and $\frac{\pi}2$; for $z$ in the second quadrant it’s between $\frac{\pi}2$ and $\pi$; for $z$ in the third quadrant it’s between $-\frac{\pi}2$ and $-\pi$; and for $z$ in the fourth quadrant it’s between $0$ and $-\frac{\pi}2$. This means that the $\tan^{-1}$ function gives you the correct angle only when $z$ is in the first and fourth quadrants.
When $z$ is in the second quadrant, you have to find an angle between $\frac{\pi}2$ and $\pi$ that has the same tangent as the angle $\theta$ returned by the $\tan^{-1}$ function, which satisfies $-\frac{\pi}2<\theta\le 0$. The tangent function is periodic with period $\pi$, so $\tan(\theta+\pi)=\tan\theta$, and $$\frac{\pi}2=-\frac{\pi}2+\pi<\theta+\pi\le0+\pi=\pi\;,$$ so $\theta+\pi$ is indeed in the second quadrant.
When $z$ is in the third quadrant, you have to find an angle between $-\pi$ and $-\frac{\pi}2$ that has the same tangent as the angle $\theta$ returned by the $\tan^{-1}$ function, which satisfies $0\le\theta<\frac{\pi}2$. This time subtracting $\pi$ does the trick: $\tan(\theta-\pi)=\tan\theta$, and
$$-\pi=0-\pi<\theta-\pi<\frac{\pi}2-\pi=-\frac{\pi}2\;.$$
There’s just one slightly tricky bit. If $z$ is a negative real number, should you consider it to be in the second or in the third quadrant? The tangent is $0$, so the $\tan^{-1}$ function will return $0$. If you treat $z$ as being in the second quadrant, you’ll add $\pi$ and get a principal argument of $\pi$. If instead you treat $z$ as being in the third quadrant, you’ll subtract $\pi$ and get a principal argument of $-\pi$. But by definition the principal argument is in the half-open interval $(-\pi,\pi]$, which does not include $-\pi$; thus, you must take $z$ to be in the second quadrant and assign it the principal argument $\pi$.
Compute the modulus:
$$
|1+i\tan x|^2=1+\tan^2x=\frac{1}{\cos^2x}
$$
Depending on whether $\cos x>0$ or $\cos x<0$, the modulus is $1/\cos x$ or $-1/\cos x$.
Case $\cos x>0$
$$
1+i\tan x=\frac{1}{\cos x}(\cos x+i\sin x)
$$
and the argument is $x$ (reduced to whatever interval you choose as the principal one).
Case $\cos x<0$
$$
1+i\tan x=\frac{-1}{\cos x}(-\cos x-i\sin x)=
\frac{-1}{\cos x}(\cos(\pi+x)+i\sin(\pi+x))
$$
and the argument is $\pi+x$ (reduced to whatever interval you choose as the principal one).
Best Answer
On substituting $z = x+iy$ you do get:
$$w = \left(\frac{x-1+iy}{x+1+ iy}\right) = \frac{(x-1+iy)(x+1-iy)}{(x+1)^2+(y^2)} = \frac{x^2+y^2-1}{(x+1)^2+(y^2)}+i \frac{2y}{(x+1)^2+(y^2)}$$
From here it is clear that since $\arg w = \tfrac{\pi}{4}$, we have $\tan (\arg w) = 1$
$$\frac{2y}{x^2+y^2-1}=1$$
But here, as you noted, we do need that $2y > 0$ and $x^2+y^2 - 1 > 0$, since $w $, belongs to first quadrant as $\arg w $ is acute.
Alternatively you can solve it using vectors. Two vectors one starting $-1$ and pointed towards $z$ and other starting at $1$ and pointed towards $z$. The angle between them needs to be $45^\circ$ and the angle which $z-1$ vector makes with $+x$ axis needs to be greater here.
You will get major arc of $x^2+y^2 -2y-1 = 0$ with ends $-1$ and $1$ as the answer in either way.
This link might be helpful: Desmos Graph. The desired curve is major arc of red circle with ends $-1,1$: