I have two questions I need to answer:
Let $\mathbb{X}$ be a set and $f : \mathbb{X} \rightarrow \mathbb{R}$ a function. Define $$ d : \mathbb{X} \times \mathbb{X} \rightarrow \mathbb{R}, ~d(x,y) = |f(x) - f(y)| $$ State which properties $f$ must fulfill in order for $d$ to be a metric, and prove that they are suffecient and necessary.
The only property I am certain that $f$ must have, is that $f$ must be injective. This is to ensures that $d(x,y) = 0 \Leftrightarrow x = y$. I'm having trouble finding out how to show that this must be true though and that you don't need anything else, but I assume that it simply involves showing that it injective functions also make $d$ fulfill all the other requirements for $d$ to be a metric (triangle inequality, non-negativity and symmetry). Non-negativity and symmetry is obvious since $d$ is the absolute value of the difference between $f(x)$ and $f(y)$. I assume that the triangle inequality is equally simple.
Given points $u, v, w, x$ in a metric space $(\mathbb{X}, d)$ prove that $$|d(u,v) - d(w, x)| \leq d(u, w) + d(v, x)$$ Use this result to prove that for sequences $\{x_n\}$, $\{y_n\}$ in $\mathbb{X}$ with $\lim_{n\rightarrow \infty}x_n = x \in \mathbb{X}$, $\lim_{n\rightarrow \infty}y_n = y \in \mathbb{X}$ it holds $$\lim_{n\rightarrow \infty}d(x_n, y_n) = d(x, y)$$
I'm assuming this is bascially using the triangle inequality to show the first part.
What I'm really asking is for hints on how to formulate the proofs, not the proofs themselves.