Find the domain, co-domain and range of the given function $f:\mathbb{Q}\to\mathbb R$   
$f(x) = \sin{\left (\pi x \right )} $,
$ $
And $g:\mathbb{Z}\to\mathbb{Q}$ 
$g(x) = \frac{2 x}{3}$
We have to write down $h(x)$ where $h(x)$ = $f(g(x))$
And then find the domain, co-domain and range of $h(x)$
I wrote $h(x)=\sin(\frac{2πx}{3}$)
And I wrote that the domain is all real numbers. Since you can literally plug in any $x$ and still find a value for $h(x)$
And since its a  $sin$  function, that value for $h(x)$ is between -1 and 1, hence the range is between -1 and 1 
Co-domain, Im not too sure. But I think its $x$ because $\frac{2πx}{3}$ "transforms" to $x$
My teacher said that I am wrong. Can anyone please help me figure this out?
Please dont give me hints and expect me to figure it out for myself, hahaha, I just tried that for two hours and am really frustrated. Just tell me why I am wrong and what I did wrong. Thank you, I'd really appreciate it :D 
Furthermore, I know that this function $h(x)$ is not injective.
But can anyone please tell me the reason why its not surjective?
Thank you for your help.
 A: Here, $g(x)$ takes in something from $\Bbb{Z}$ and then outputs something in $\Bbb{Q}$. Then, $f(g(x))$ takes in $g(x)$, which is from $\Bbb{Q}$, and outputs something in $\Bbb{R}$.
What we originally take in is the domain of the function. In this case, we originally take in something from $\Bbb{Z}$, so the domain is all integers, not all real numbers. This might seem confusing because you can put a real number into $\sin(\frac{2\pi x} 3)$ and get a real answer. However, in this question, they specifically say $g(x)$ can only take in an integer, so that has to apply to $f(g(x))$ as well.
The codomain is the last thing we output. As I said above, the last thing we output is something from $\Bbb{R}$, so the codomain is all real numbers.
Now, your analysis of the range would be correct if the domain was actually all real numbers. However, it's not. $x$ must be an integer, so this limits what $\sin(\frac{2\pi x} 3)$ can be. To find the range, just keep going through integers and then stop once the pattern repeats itself. (We know there will be a pattern because this is $\sin x$, which is a periodic function.)


*

*$x=0$ -> $h(x)=0$

*$x=1$ -> $h(x)=\frac{\sqrt 3}{2}$

*$x=2$ -> $h(x)=-\frac{\sqrt 3}{2}$

*$x=3$ -> $h(x)=0$

*$x=4$ -> $h(x)=\frac{\sqrt 3}{2}$


Clearly, the pattern has repeated, so we stop. This shows us the possible values that can come out of $h(x)$ are $\{0, \frac{\sqrt 3}{2}, -\frac{\sqrt 3}{2}\}$, so that set is the range.
Now, a function is surjective if and only if the range and codomain are the same. We just showed that the range is not all real numbers, so the range and codomain are different. This is why $h(x)$ is not surjective.
A: You are wrong because the domain of the function is not $ x\in\mathbb{R}$ but $x \in \mathbb{Z}$ ( do you see this ?).
So the possible values of $\sin(\frac{2 \pi x}{3})$ are in the set $\{0,\pm\frac{\sqrt{3}}{2}\}$
