Trouble understanding injection problem Went over a problem today that $f:\mathbb{Q}\rightarrow \mathbb{R}$ defined by $f(x)=\sin x$ is injective.Can someone explain to me the reason, and clear up confusion?
Proof:Here was the proof given.
Assume $f(x_1)=f(x_2)$
$\implies \sin (x_1) = \sin (x_2)$
$\implies x_2=2n\pi +x_1$ or $x_2=(2n+1)\pi-x_1$ for $n\in \mathbb{Z}$
Case1:$x_2=2n\pi +x_1$
Since$x_1,x_2$ are rational $n$ must be $0$ thus 
$x_2=2(0)\pi +x_1 \implies x_1=x_2$
Case2:$x_2=(2n+1)\pi-x_1$
But since $(2n+1)\pi$ is never rational this case cannot happen.
Here is where my confusion begins:First, it does not seem like we evaluated the sine function $f(x)$ at any particular x value($x_1$ and $x_2$).We just determined the intervals where any particular $x$ is periodically equal to $f(x)$.It seems like equal values in the domain,were shown to prove injectivity.Values in the range were never used.  Second I cannot wrap my head around why the function is injective since it appears to me $\sin (0)=0$ would be repeated, unless the domain is restricted.
 A: First: verifying injectivity is not about evaluating at any particular value of the domain. It is about proving that different inputs yield different outputs, or equivalently, that if we have the same outputs, then they come form the same input.
For instance, showing that $f\colon\mathbb{R}\to\mathbb{R}$ given by $f(x)=x^3$ is injective is not about evaluating $x^3$ at any particular value, but rather about showing that if $f(x_1)=f(x_2)$, then $x_1=x_2$.
Second, don’t confuse inputs with outputs! While it is true that $\sin(0)=0$, the zero on the left hand side is playing a very different role from the zero on the right hand side: the zero on the left is an input, the zero on the right is an output. Remember what injectivity means: either “different inputs yield different outputs” or “if ‘two’ inputs yield the same output, then they are actually the same input.”
So you don’t compare the input $0$ with the output $0$. It doesn’t matter that the output is the same as the input, because we don’t compare inputs with outputs: we compare outputs with outputs, inputs with inputs. 

Second:  the “proof” you are given is just plain wrong..  While it is true that if $x_2=2n\pi + x_1$ then $\sin(x_2)=\sin(x_1)$, this is not the only way in which you can have $\sin(x_2)=\sin(x_1)$. And while it is true that for some values of $x_1$, $\sin(x_1)$ will have the same value as $\sin(x_2)$ with $x_2=(2n+1)\pi-x_1$, for arbitrary real numbers it does not follow that th is is the only way. For instance, $\sin(\frac{\pi}{4}) = \sin(\frac{3\pi}{4})$, but $x_1=\frac{\pi}{4}$ and $x_2=\frac{3\pi}{4}$ do not have the given form. 
For real numbers, it is not true that $\sin(x_1)=\sin(x_2)$ implies that either $x_2=2n\pi+x_1$ or else that $x_2 = (2n+1)\pi + x_1$. So for the given argument to work, you would need to somehow show that this implication holds if we further assume that $x_1$ and $x_2$ are rational... but that is essentially what you are trying to prove in the first place (because the final step here is trivial). I doubt very much that this has been established before this problem. As such, I just say “Bad exercise, false proof.”
