Let $X=\left\{f\in\mathbb{N}^\mathbb{N} : \;|f(n + 1)-f(n)|=1\right\}$. Prove that cardinality of $X$ is continuum. Let
$$X=\left\{f\in\mathbb{N}^\mathbb{N} : \;|f(n + 1)-f(n)|=1\right\}$$
Prove that cardinality of $X$ is continuum.
I have no idea how to solve it. Could somebody show me example of a sotution?
 A: One idea could be to give an injection $\def\P{\mathfrak P}\def\N{\mathbb N}\P(\N) \to X$. To encode an $A \subseteq \N$ by a function in $X$, the idea could be to go "one up" at $n$ if $n \in A$ and "one down" if $n \not\in A$. As we must make sure to go up often enough to ensure $f\colon \N \to \N$, we can add a step up before every encoding step.
That is, for $A \subseteq \N$ define by induction $f_A \colon \N \to \N$ by 
\begin{align*}
  f(0) &:= \begin{cases} 0 & 0 \not\in A\\ 
                        1 & 0 \in A\\
          \end{cases}\\
  f(n) &:= \begin{cases} f(n-1) + 1 & n \text{ odd}\\ 
                         f(n-1) + 1 & n \text{ even } \frac n2 \in A\\
                         f(n-1) - 1 & n \text{ even } \frac n2 \not\in A
           \end{cases}, \quad n \ge 1
\end{align*}
Then $\P(\N) \ni A \mapsto f_A \in X$ is one-to-one, and hence $\left|X\right| \ge \mathfrak c$, on the other hand $\left|X\right|\le \left|\N^\N\right| = \mathfrak c$.
A: First let's have a look at the case $f\in\Bbb Z ^{\Bbb N}$. Given $f(0)$, you can choose value of $f(1)$ among $f(0) \pm 1$, then $f(2)$ among $f(1)\pm 1$, etc. If you fix $f(0)=0$, then you have a natural bijection between your functions (with $f(0)=0$) and $[0,1[$ (write numbers in binary, and use the bit $b_n=0/1$ at position $n$ to define $f(n+1)=f(n)+(-1)^{b_n}$. So you have an injection $[0,1[ \to X$, and it's enough to prove cardinality, since this cardinal must be at most $\mathrm{card} \, \Bbb N^{\Bbb N}$, which is also the same as $\Bbb R$.
Here it's slightly more difficult, because your functions cannot have negative values. Just intersperse "step-ups" like in martini's answer to cope with this. Of course you will only have an injection $[0,1[ \to X$, but again, it's not a problem.
