Dirichlet characters mod $q$ of conductor $f_\chi|d|q$ Let $\hat{G}_q$ be the set of Dirichlet characters modulo $q$. If $d|q$, how many $\chi\in\hat{G}_q$ are there with $f_\chi|d$? ($f_\chi$ denotes the conductor of $\chi$)

And what if we count the $\chi\in\hat{G}_q$ with $f_\chi|d$ and $\chi(-1)=\pm1$? I expect the number to be $\frac12\phi(d)$ but don't know how to prove that.

Thanks alot!
There are $\phi(q)$ Dirichlet characters modulo $q$ 
If $\chi$ is a Dirichlet character modulo $d | q$ then $\tilde{\chi}(n)=\chi(n) 1_{gcd(n,q)=1}$ is a Dirichlet character modulo $q$.
Let $f(q)$ be the number of primitive Dirichlet characters modulo $q$ then


$$\phi(q) =\sum_{d | q} f(d) \quad \\ \implies \quad f(q) = \sum_{d | q} \mu(d) \phi(q/d) = \prod_{p^k \| q} f(p^k)= \prod_{p^k \| q} (\phi(p^k)-\phi(p^{k-1}))$$


For $q &gt; 2$ : the map $\{ \chi \bmod q \} \to \{-1,1\}$,  $\chi  \mapsto \chi(-1)$ is a surjective group morphism with kernel the Dirichlet characters with $\chi(-1) = 1$. Thus there are $\phi_1(q) = \frac{\phi(q)}{2}$ Dirichlet characters modulo $q$ with $\chi(-1)= 1$ (excepted the special case $\phi_1(1)= \phi_1(2) =1$). 

Also $\tilde{\chi}(-1) = \chi(-1)$ thus again (with $f_1(q)$ the number of primitive characters modulo $q$ with $\chi(-1)=1$)
$$\phi_1(q) =\sum_{d |q} f_1(q)  \implies f_1(q) = \sum_{d | q} \mu(d)\phi_1(q/d) = \frac{\mu(q)+\mu(q/2)+f(q)}{2}$$
and hence $$f_{-1}(q) = f(q)-f_1(q) = \frac{-\mu(q)-\mu(q/2)+f(q)}{2}$$
Ok, maybe I got it by myself: Let us define $\hat{P}_{d,\pm}:=\{\text{primitive Dirichlet characters $\tilde{\chi}$ with conductor dividing }d\text{ and }\tilde{\chi}(-1)=\pm1\}$ and $\hat{G}_{d,\pm}=\{\chi\in\hat{G}_q:f_\chi|d\text{ and }\chi(-1)=\pm1\}$. Let $\varphi:\hat{G}_{d,\pm}\longrightarrow \hat{P}_{d,\pm}$, $\chi\mapsto\chi'$, $\chi'$ the primitive character inducing $\chi$.

If $\tilde{\chi}\in\hat{P}_{d,\pm}$, set $\chi(n)=\tilde{\chi}(n)$ for all $(n,q)=1$ and $0$ otherwise. Thus, $\chi\in\hat{G}_q$ and $\tilde{\chi}$ induces $\chi$. So $\varphi(\chi)=\chi'$ and $\tilde{\chi}$ both are primitive inducing $\chi$, therefore $\varphi(\chi)=\tilde{\chi}$. But as $f_\chi=f_{\chi'}=f_{\tilde{\chi}}$ and $\chi(-1)=\chi(q-1)=\tilde{\chi}(q-1)=\pm1$ we got $\chi\in\hat{G}_{d,\pm}$. The uniqueness of $\chi$ is obvious. So we got $\hat{G}_{d,\pm}\cong\hat{P}_{d,\pm}$. Now, as $\hat{P}_d\cong\hat{G}_d$ it follows easily that $|\hat{P}_{d,\pm}|=\frac12\phi(d)$.