As I understand it, a given function, $f$ (sticking to one dimension for simplicity) is said to be translationally invariant if $$f(x+a)=f(x)$$ for any arbitrary constant $a\in\mathbb{R}$. This condition then implies that $f$ cannot have any functional dependence on position $x$, since it must hold for any value $a\in\mathbb{R}$.
Furthermore, generalising slightly, a so-called two-point function (using "physics lingo"), $g$ is said to be translationally invariant if $$g(x+a, y+a)=g(x,y)$$ where $a\in\mathbb{R}$ is any arbitrary constant. For this condition to hold for any $a\in\mathbb{R}$, it must be the case that $g$ can (at most) only be dependent on the relative separation $x-y$, such that $g(x,y)\equiv g(x-y)$.
My question is, can one show in a more mathematically rigorous way (as opposed to the heuristic arguments that I have given) why $f(x+a)=f(a)\Rightarrow f=\text{constant}$, and $g(x+a,y+a)=g(x,y)\Rightarrow g\equiv g(x-y)$?
Monodimensional case
We suppose that $$f(x+a) = f(x) ~\forall a, x.$$ Then it is also true that: $$f(a+x) = f(a) ~\forall a, x.$$
We can conclude that $f(x) = f(a) ~\forall a, x$, and hence $f(x)$ is constant.
Bidimensional case
We suppose that $$g(x,y) = g(x+a, y+a) ~\forall a, x, y.$$
Let's pose $z = y+a$, and hence $a = -y+z$. Then:
$$g(x,y) = g(x-y+z, z) = g(x-y, 0).$$
Then, $g(x,y)$ is function of $x-y$ only.
Alternatively, this can be proven as follows:
$$g(x,y) = g(x-y,y-y) = g(x-y,0).$$