This question is something of a follow-up to
https://mathoverflow.net/questions/19400/ .

How does one recognise whether a subgroup of the modular group
$\Gamma=\mathrm{SL}_2(\mathbb{Z})$ is a congruence subgroup?

Now that's too broad a question for me to expect a simple answer
so here's a more specific question. The subgroup $\Gamma_1(4)$
of the modular group is free of rank $2$ and freely generated by
$A=\left(
\begin{array}{cc}
1&1\\\
0&1
\end{array}\right)$
and
$B=\left(
\begin{array}{cc}
1&0\\\
4&1
\end{array}\right)$. If $\zeta$ and $\eta$ are roots of unity there is a
homomorphism $\phi$ from $\Gamma_1(4)$ to the unit circle group
sending $A$ and $B$ to $\zeta$ and $\eta$ resepectively. Then the kernel $K$
of $\phi$ has finite index in $\Gamma_1(4)$. How do we determine whether $K$
is a congruence subgroup, and if so what its level is?

In this example, the answer is yes when $\zeta^4=\eta^4=1$. There are
also examples involving cube roots of unity, and involving eighth
roots of unity where the answer is yes. I am interested in this example
since one can construct a "modular function" $f$, homolomorphic on
the upper half-plane and meromorphic at cusps such that $f(Az)=\phi(A)f(z)$
for all $A\in\Gamma_1(4)$. One can take $f=\theta_2^a\theta_3^b\theta_4^c$
for appropriate rationals $a$, $b$ and $c$.

Finally, a vaguer general question. Given a subgroup $H$ of
$\Gamma$ specified as the kernel of a homomorphism from $\Gamma$ or
$\Gamma_1(4)$ (or something similar) to a reasonably tractable target group,
how does one determine whether $H$ is a congruence subgroup?