Does this function ever have the same value twice?

Solution 1:

The result is true for your $g(x)$.

For real numbers $u, v$, if $\cos(u) = \cos(v)$ and $\sin(u) = \sin (v)$, then we must have $u - v \in 2\pi \Bbb Z$.

Thus if $x, y$ are different real numbers such that $g(x) = g(y)$, then we must have $ax - ay \in 2\pi \Bbb Z$ and $bx - by \in 2\pi \Bbb Z$, where $a = \sqrt 2$ and $b = \sqrt 3$.

Taking quotient of the two, we get $a/b \in \Bbb Q$ which is false.


It is however not true for your $f(x)$. Take e.g. $x = -y = \frac \pi {\sqrt 3}$.