Let $\Gamma_0(4)$ be a congruence subgroup of $SL(2,\mathbb{Z})$ defined as $$\Gamma_0(4)=\Big\{M=\begin{pmatrix} a &b\\ c& d \end{pmatrix}\in SL(2,\mathbb{Z}) | c \equiv 0\bmod 4\Big\}.$$ How to show that cusp of $\Gamma_0(4)$ is $0,\frac{1}{2},\infty$?I have looked up the answer: Inequivalent cusps of $\Gamma_0(4)$, but I do not understand. We define the group action: if $\forall \gamma \in SL(2,\mathbb{Z})$, $$ \gamma \infty= \begin{cases} \frac{a}{c}, c\neq 0\\ \infty, c=0 \end{cases}$$
$$ \gamma z= \begin{cases} \frac{az+b}{cz+d}, cz+d \neq 0\\ \infty, cz+d=0 \end{cases}$$
I try to use the same method of proof $\Gamma_0(2)$ cusp $0,\infty$.
For $\forall \frac{p}{q}$, if $q$ is even, there exists $r,s\in \mathbb{Z}$, s.t. $rp-sq=1$, we have
$$\begin{pmatrix} p &s\\ q& r \end{pmatrix} \infty = \frac{p}{q},$$ where $\begin{pmatrix} p &s\\ q& r \end{pmatrix} \in \Gamma_0(2)$.
if $q$ is odd, there exists $r,s\in \mathbb{Z}$, sinece $\gcd(2p,q)=1$, s.t. $-2rp+sq=1$, we have
$$\begin{pmatrix} s &p\\ 2r& q \end{pmatrix} 0 = \frac{p}{q}, $$ where $\begin{pmatrix} s &p\\ 2r& q \end{pmatrix} \in \Gamma_0(2)$.
Similarly, for $\Gamma_0(4)$, I have known $0, \infty$ and $0,\frac{1}{2}$ are not equivalent. $\textbf{But for $\forall \frac{p}{q}\in \mathbb{Q}$, how to find the matrix $\gamma \in \Gamma_0(4)$}$, s.t. $$ \gamma \frac{1}{2}=\frac{p}{q}.$$
If $q \equiv 0 \mod4$, $\gcd(p,q)=1$, it is easy to seek the $$\begin{pmatrix} p &s\\ q& r \end{pmatrix} \infty = \frac{p}{q},$$ where $\begin{pmatrix} p &s\\ q& r \end{pmatrix} \in \Gamma_0(4)$.
How about the $q \equiv 1,2,3 \mod4$?
This is addressed in the third erratum of the book at the page 103 note http://people.reed.edu/~jerry/MF/errata3.pdf
You should check all four errata if you have not done so yet, as there are quite a few mistakes that can make things confusing.
You might also want to look at this Modular Forms: Find a set of representatives for the cusps of $\Gamma_0(4)$