Answer
a-f is not one-to-one
b-f is not onto
Work Step by Step
$N:S\rightarrow \mathbb{Z} \\
Let\,S\,be\,the\,set\,of\,all\,strings\,of\,a\,^{,}s\,\,and\,b\,^{,}s\,\,\\
N(s) =\,the\,number\,of\,a\,^{,}s\,\,in\,\,s,\,\,for\,\,all\,\,s \in S.\\
A\,function\,\,N:S\rightarrow \mathbb{Z} \\
\,is\,not\,\,\,one-to-one\,\Leftrightarrow \\
\exists \,\,x_{1}\,and\,x_{2}\,\,in\,\,S\,\,such\,that\,\,
N(x_{1}) = N(x_{2})\,\,and x_{1} \neq x_{2}.\\
N(aaabbb)=N(aaa)=3 ,and\,\,\,\,aaabbb\neq aaa \\
N:S\rightarrow \mathbb{Z} \\
is\,\,not\,\,onto\,\Leftrightarrow \,\\
\exists y\,in\,\mathbb{Z} such\,that\,\forall x \in S, f(x) \neq y.\\
for\,example\,-1\in\mathbb{Z}\,there\,is\,no\,\,x\in S \, suchthat\,f(x)=-1\\
(as\,the\,number\,of\,a^{,}s\,can\,not\,be\,-1)\\
f\,\,is\,\,not\,\,onto
$