[proofplan]
We first check that the denominator $cz+d$ never vanishes on the upper half-plane, so the fractional [linear map](/page/Linear%20Map) is well-defined. We then write $z=x+iy$ and compute the imaginary part after multiplying numerator and denominator by $c\bar z+d$. The determinant condition $ad-bc=1$ gives the stated formula, which also shows that the upper half-plane is preserved. Finally, we verify holomorphicity, inverses, and compatibility with multiplication to obtain the asserted $SL_2(\mathbb{Z})$-action by holomorphic automorphisms.
[/proofplan]
[step:Show the fractional linear expression is defined on $\mathbb{H}$]
Let $z \in \mathbb{H}$. Suppose first that $c=0$. Since $\gamma \in SL_2(\mathbb{R})$, we have $ad-bc=ad=1$, so $d \neq 0$, and hence $cz+d=d \neq 0$.
Suppose now that $c \neq 0$. If $cz+d=0$, then
\begin{align*}
z=-\frac{d}{c}.
\end{align*}
Since $c,d \in \mathbb{R}$, the number $-d/c$ is real, contradicting $z \in \mathbb{H}$. Therefore $cz+d \neq 0$ for every $z \in \mathbb{H}$, and $T_\gamma$ is well-defined on $\mathbb{H}$.
[/step]
[step:Compute the imaginary part by rationalising the denominator]
Let $z=x+iy$, where $x,y \in \mathbb{R}$ and $y>0$. Since $cz+d \neq 0$, we may multiply numerator and denominator by $c\bar z+d$:
\begin{align*}
T_\gamma(z)
&=\frac{az+b}{cz+d}
=\frac{(az+b)(c\bar z+d)}{(cz+d)(c\bar z+d)} \\
&=\frac{ac|z|^2+ad z+bc\bar z+bd}{|cz+d|^2}.
\end{align*}
The denominator $|cz+d|^2$ is a positive real number. The terms $ac|z|^2$ and $bd$ are real, while
\begin{align*}
\operatorname{Im}(ad z+bc\bar z)
&=ad\,\operatorname{Im}(z)+bc\,\operatorname{Im}(\bar z) \\
&=ad\,y-bc\,y \\
&=(ad-bc)y.
\end{align*}
Because $\gamma \in SL_2(\mathbb{R})$, $ad-bc=1$. Hence
\begin{align*}
\operatorname{Im}(T_\gamma(z))
=\frac{y}{|cz+d|^2}
=\frac{\operatorname{Im}(z)}{|cz+d|^2}.
\end{align*}
[guided]
Let $z=x+iy$ with $x,y \in \mathbb{R}$ and $y>0$. The goal is to isolate the imaginary part of
\begin{align*}
\frac{az+b}{cz+d}.
\end{align*}
The denominator is nonzero by the previous step, so multiplying numerator and denominator by the complex conjugate $c\bar z+d$ is legitimate. This gives
\begin{align*}
T_\gamma(z)
&=\frac{az+b}{cz+d}
=\frac{(az+b)(c\bar z+d)}{(cz+d)(c\bar z+d)} \\
&=\frac{ac z\bar z+ad z+bc\bar z+bd}{|cz+d|^2} \\
&=\frac{ac|z|^2+ad z+bc\bar z+bd}{|cz+d|^2}.
\end{align*}
The denominator $|cz+d|^2$ is a positive real number, so the imaginary part of the quotient is the imaginary part of the numerator divided by $|cz+d|^2$.
Now $ac|z|^2$ and $bd$ are real because $a,b,c,d \in \mathbb{R}$ and $|z|^2 \in \mathbb{R}$. Thus only $ad z+bc\bar z$ contributes to the imaginary part. Since $\operatorname{Im}(z)=y$ and $\operatorname{Im}(\bar z)=-y$, we compute
\begin{align*}
\operatorname{Im}(ad z+bc\bar z)
&=ad\,\operatorname{Im}(z)+bc\,\operatorname{Im}(\bar z) \\
&=ad\,y-bc\,y \\
&=(ad-bc)y.
\end{align*}
The determinant condition for $\gamma \in SL_2(\mathbb{R})$ is exactly $ad-bc=1$, so this becomes $y$. Therefore
\begin{align*}
\operatorname{Im}(T_\gamma(z))
=\frac{y}{|cz+d|^2}
=\frac{\operatorname{Im}(z)}{|cz+d|^2}.
\end{align*}
[/guided]
[/step]
[step:Deduce that each transformation preserves the upper half-plane]
For every $z \in \mathbb{H}$, the formula just proved gives
\begin{align*}
\operatorname{Im}(T_\gamma(z))
=\frac{\operatorname{Im}(z)}{|cz+d|^2}.
\end{align*}
Here $\operatorname{Im}(z)>0$ and $|cz+d|^2>0$, so $\operatorname{Im}(T_\gamma(z))>0$. Hence $T_\gamma(z) \in \mathbb{H}$ for every $z \in \mathbb{H}$, and therefore
\begin{align*}
T_\gamma: \mathbb{H} \to \mathbb{H}
\end{align*}
is a well-defined map.
[/step]
[step:Verify holomorphicity and identify the inverse transformation]
Since $z \mapsto az+b$ and $z \mapsto cz+d$ are complex polynomial maps and $cz+d$ has no zero on $\mathbb{H}$, the quotient
\begin{align*}
T_\gamma: \mathbb{H} &\to \mathbb{H} \\
z &\mapsto \frac{az+b}{cz+d}
\end{align*}
is holomorphic. Its complex derivative is
\begin{align*}
T_\gamma'(z)
&=\frac{a(cz+d)-c(az+b)}{(cz+d)^2} \\
&=\frac{ad-bc}{(cz+d)^2} \\
&=\frac{1}{(cz+d)^2}.
\end{align*}
The inverse matrix is
\begin{align*}
\gamma^{-1}=
\begin{pmatrix}
d & -b \\
-c & a
\end{pmatrix}
\in SL_2(\mathbb{R}).
\end{align*}
For every $z \in \mathbb{H}$, direct substitution gives
\begin{align*}
T_{\gamma^{-1}}(T_\gamma(z))=z
\quad\text{and}\quad
T_\gamma(T_{\gamma^{-1}}(z))=z.
\end{align*}
Thus $T_\gamma$ is a bijective holomorphic map $\mathbb{H} \to \mathbb{H}$ whose inverse $T_{\gamma^{-1}}$ is also holomorphic. Hence $T_\gamma$ is a holomorphic automorphism of $\mathbb{H}$.
[/step]
[step:Check that integer matrices give a group action by automorphisms]
Let
\begin{align*}
\eta=
\begin{pmatrix}
e & f \\
g & h
\end{pmatrix}
\in SL_2(\mathbb{Z}).
\end{align*}
For $z \in \mathbb{H}$, set $w=T_\eta(z)$. Since $T_\eta(z) \in \mathbb{H}$, the expression $T_\gamma(w)$ is defined. A direct computation gives
\begin{align*}
T_\gamma(T_\eta(z))
&=\frac{a\frac{ez+f}{gz+h}+b}{c\frac{ez+f}{gz+h}+d} \\
&=\frac{(ae+bg)z+(af+bh)}{(ce+dg)z+(cf+dh)} \\
&=T_{\gamma\eta}(z).
\end{align*}
Also $T_I(z)=z$ for the identity matrix $I \in SL_2(\mathbb{Z})$. Therefore the assignment $\gamma \mapsto T_\gamma$ is an action of $SL_2(\mathbb{Z})$ on $\mathbb{H}$. Since every $T_\gamma$ with $\gamma \in SL_2(\mathbb{Z})$ is a holomorphic automorphism by the previous step, this action is by holomorphic automorphisms.
[/step]