We define $\mathbb{E}^2 = (\mathbb{R}^2, d_E)$, where $d_E$ is the usual Euclidean metric on $\mathbb{R}^2$.
We say that a function $f:X \rightarrow Y$, where $X, Y$ are metric spaces, is an isometry if it is surjective and $\forall x, y \in X: d(f(x), f(y)) = d(x, y)$.
So I understand that, for example, in $\mathbb{E}^2$, the function $f(x) = x + a$, where $a \in \mathbb{R}^2$ is an isometry (a translation).
How can I understand the following question?
Is the following function an isometry of of $\mathbb{E}^2$?
$f(x,y) =(y,x)$
I'm not sure how to deal with this because $f$ seems to go from $\mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^2 \times \mathbb{R}^2$ instead of $\mathbb{R}^2 \rightarrow \mathbb{R}^2$.
Let $(x,y) \in \mathbb{E}^2$, then $(y,x)\in \mathbb{E}^2$ and $f(y,x)=(x,y)$, so $f$ is surjective.
Let $(x_1,y_1),(x_2,y_2) \in \mathbb{E}^2$, then $f(x_1,y_1)=(y_1,x_1)$ and $f(x_2,y_2)=(y_2,x_2)$ and
$$d((x_1,y_1),(x_2,y_2))= \sqrt{(x_1-x_2)^2 + (y_1-y_2)^2}$$ $$d(f(x_1,y_1),f(x_2,y_2))= d((y_1,x_1),(y_2,x_2))=\sqrt{(y_1-y_2)^2 + (x_1-x_2)^2} $$
Since addition is commutative we have that $f$ preserves metric and hence is an isometry.