TITLE: Beginner questions about how functions work
QUESTION [17 upvotes]: Background
First I apologize because the following are very elementary and annoying questions about functions. But I could sure use help. It's distressing to me that I'm trying to get better at math but I don't even understand a fundamental concept like functions... please explain very pedantically because I am a little slow.
Statement in question
Let's say: $\forall x,y \quad f(x) = g(x+y)$
My questions

Is it correct to say that $g(x+y)$ is a function of one variable or two variables?

My attempt: It's clear to me that $g(x)$ is a function of one variable and $g(x,y)$ is a function of two variables. But I'm not sure about $g(x+y)$. I would guess $g$ is a function of a function and the inner function can be thought of as "one variable" that has "two variables." That seems really convoluted...

What are some trivial examples of the statement above? My attempts:

My trivial example A: $f(x)=C$ and $g(x+y) = x+y$
My trivial example B: $f(x)=C$ and $g(x+y) = (x+y)^{30} + y^{x} - x$
My trivial example C: $f(x) = 42$ and $g(x+y) = 42$
My trivial example D: $f(x) = 11$ and $g(x+y) = 5u - u$
Are those acceptable trivial examples? In my last example I switched it up to $u$ on purpose... kind of shooting in the dark. Can you give me some trivial examples if mine are wrong?

Is it true that $\forall x,y \quad$ if $f(x) = g(x,y)$ then the LHS must be a constant?

I know how to prove it if it's $g(x+y)$ but not for $g(x,y)$. If this is not true can you give me a trivial counter example?

Let's say that $h(x,y)$ is a function of distance. Then you can say $h(x,y) = k(x^{2}+y^{2})$. You don't have to put the square root part of the distance function into $k$ because that can be part of the function $k()$ itself. But I don't think you can "simplify" it further from $x^{2}+y^{2}$. Correct? It's interesting to me that $k((x^{2}+y^{2})^{50})$ can be called a "function based on distance" even though it is powered to the 50 and the distance formula is powered to 0.5...

Thank you for your help and patience!

REPLY [2 votes]: A function is defined in term of sets. Functions can act on elements/points and very importantly, also on sets. 
The two central and formal sets used to define a function are: 


A set called the Domain, $D$.
A set called the Co-domain, $C$.

$f: D \to C$ means: $\forall x \in D$, $f(x) \in C$.

The set $G=\{f(x)|x\in D\} \subseteq C$ is called the Image of $f$.
For every $U \subseteq C$, the set $f^{-1}(U) = \{x|f(x)\in U\} \subseteq D$ (Where I used action on sets) is called the Preimage of $U$. ($f^{-1}$ in this context is defined $\mathcal{P}(C)\to \mathcal{P}(D)$, and is not the inverse of $f$ that need not necessarily exist)


Example: The absolute value function from the domain of real numbers to the codomain of real numbers:
$$f: \mathbb{R} \to \mathbb{R}, f(x)=|x|= \begin{cases} x & x \geq 0 \\ -x & x < 0 \end{cases}$$
The image in this case is $G=\{x|x\geq0\} \subset \mathbb{R}$.
For every $x \in G$ the preimage is $f^{-1}(\{x\})=\{x,-x\}$ beacuse the rule $x \mapsto |x|$ maps both positive and negative versions of $x$ to the positive  $|x|$.
Let's consider the Cartesian product $D \times C$. all subsets $F \subseteq D \times C$ are called relations. 

A relation $R$ is a function if and only if 
1.1: $xRy \land xRz \implies y=z$. Equivalently: $(x,y),(x,z)\in R \implies y=z$.
1.2: $\forall x \in D, \exists y \in C$ such that $(x,y) \in R$ 

A function represented by relation $R$ can be:

2.1: Injective: $xRy \land zRy \implies x=z$. ($|x|$ is not injective)
2.2: Surjective: $C=G$. i.e the image is the entire codomain.
2.3: Bijective: 2.1 and 2.2. In this case there is a two sided unique inverse.

1: $g(x+y)$ is a composition of a function $h: D \times D \to T, h(x,y)=x+y$ on the function $g: S \to A$ dentoed $g \circ h$ with the restriction that the image of $h$ which is a subset $I \subseteq T$ is the domain of $g$: $S$. More accurately this is generally a restriction of $g$ to $I \subseteq S$.
In the equation $f(x)=g(x+y)$ it is helpful to "fix" $x$. In that case the LHS is fixed as well. But $y$ is variable of $h$ and by varying $y$ you can get the entire image of $h$ regardless of $x$. This means $g$ does not depend on $y$.