When is $f+g$ guaranteed non-injective for $f,g:\mathbb{R}\to\mathbb{R}^n$ periodic? Let $n\geq1$ be a fixed integer. Let $a,b\in\mathbb{R}_{>0}$ with irrational ratio. If $f:\mathbb{R}/(a)\to\mathbb{R}^n$ and $g:\mathbb{R}/(b)\to\mathbb{R}^n$, then how many of $f$ and $g$ need to be continuous to guarantee that $f+g$ is not injective?
For $n=1$ I know the answer is one, and for $n\geq4$ I know non-injectivity cannot be implied by continuity, but I don't know the answer for $n\in\{2,3\}$.
To show that $f+g$ can be injective if $f$ and $g$ are continuous and $n=4$, define $f(x):=(\sin(2\pi x/a),\cos(2\pi x/a),0,0)$ and $g(x):=(0,0,\sin(2\pi x/b),\cos(2\pi x/b))$. Then $(f+g)(x)=(f+g)(y)$ only if $f(x)=f(y)$ and $g(x)=g(y)$ only if $x\equiv y\ (\mbox{mod}\ a)$ and $x\equiv y\ (\mbox{mod}\ b)$ only if $x=y$.
To show that $f+g$ can be injective if neither are continuous and $n=1$, let $B$ be a $\mathbb{Q}$-linear basis of $\mathbb{R}$. Since $|B|=|\mathbb{R}|$, there is an injection from the disjoint union of $\mathbb{R}/(a)$ and $\mathbb{R}/(b)$ to $B$, which we use to define $f:\mathbb{R}/(a)\to B$ and $g:\mathbb{R}/(b)\to B$. It follows that $(f+g)(x)=(f+g)(y)$ only if $x\equiv y\ (\mbox{mod}\ a)$ and $x\equiv y\ (\mbox{mod}\ b)$ only if $x=y$.
If $n=2$ then I also have a construction that does not use the axiom of choice. Let $f(x)=(x,0)$ for $x\in[0,a)$ and $g(x)=(0,x)$ for $x\in[0,b)$. Then $(f+g)(x)=(f+g)(y)$ only if $x\equiv y\ (\mbox{mod}\ a)$ and $x\equiv y\ (\mbox{mod}\ b)$ only if $x=y$.
To show that $f+g$ can not be injective if $f$ is continuous and $n=1$, note that $\mathbb{R}/(a)$ is compact, so $f$ attains a maximum and minimum. It follows that $h:\mathbb{R}/(a)\to\mathbb{R}$ defined by $h(x)=f(x)-f(x+b)$ is neither strictly positive everywhere nor strictly negative everywhere. By the intermediate value theorem, there exists $x\in\mathbb{R}$ such that $h(x)=0$, so $f(x)=f(x+b)$. Then $(f+g)(x)=f(x)+g(x)=f(x+b)+g(x+b)=(f+g)(x+b)$, so $f+g$ is not injective.
 A: For $n=3$, the functions
$$
f(x) = \big( \cos(2\pi x/a), \sin(2\pi x/a), 0 \big), \quad
g(x) = \big( 0, \sin(2\pi x/b), \cos(2\pi x/b) \big)
$$
are both continuous, but we can show that $f+g$ is injective as follows.
Suppose $(f+g)(x)=(f+g)(y)$. From the first coordinate we see that $x\equiv\pm y\pmod a$, while from the third coordinate we see that $x\equiv\pm y\pmod b$. If the two $\pm$ signs are the same, then we immediately get $x=y$ as in the OP.
So, without loss of generality, suppose that $x\equiv y\pmod a$ and $x\equiv- y\pmod b$. A little algebra shows that there exist integers $j$ and $k$ such that
$$
x=\frac{jb-ka}2 \quad\text{and}\quad y=\frac{jb+ka}2.
$$
From the second coordinate of $(f+g)(x)=(f+g)(y)$, we see that $\sin(2\pi x/a)+\sin(2\pi x/b)=\sin(2\pi y/a)+\sin(2\pi y/b)$, which becomes
$$
\sin \left(\frac{\pi  a k}{b}-\pi  l\right)+\sin \left(\frac{\pi  a k}{b}+\pi 
   l\right)+\sin \left(\pi  k-\frac{\pi  b l}{a}\right)+\sin \left(\frac{\pi  b l}{a}+\pi
    k\right) = 0,
$$
or, after using trig addition formulas and $\sin(\pi k)=0$ and $|\cos (\pi  l)|=1$,
$$
\sin   \left(\frac{\pi  a k}{b}\right)=0.
$$
But this would imply that $ka/b$ is an integer, a contradiction unless $k=0$ and hence $x=y$.
