Using continued fractions to prove a bijection. Prove that $\mathbb{N}^{\mathbb{N}} \equiv_c \mathbb{R}$
$\textbf{My Attempt:}$
Let \begin{equation*} \mathbb{N}^{\mathbb{N}}=\{f: \text{all functions} \mid f: \mathbb{N} \to \mathbb{N} \} \end{equation*} Let
\begin{equation*} g:= f \to f(\mathbb{N}) \end{equation*} In this mappings $f \in \mathbb{N}^{\mathbb{N}}$ is mapped to its image represented in decimal form. For example, if $f$ is a constant function such that $f(x)=c \hspace{2mm} \forall x \in \mathbb{N}$ then $g(f)=0.cccccccc \dots$. 
Similarly, if $f$ is the identity function then $g(f)=0.123456\dots$. 
Such a mapping $g$ is clearly bijective.
Let  \begin{equation*} h := f(\mathbb{N}) \to \mathbb{R} \end{equation*} Such that \begin{equation*} h\left (0.x_1x_2x_3\dots \right)=[x_1;x_2,x_3,x_4, \dots] \end{equation*}
Thus $h$ is a mapping from the decimal expansion to the continued fraction representation of some $x \in \mathbb{R}$.  
Note that $h$ is onto because every element $x \in \mathbb{R}$ can be represented as a continued fraction.Also, $h$ is one-to-one because the unique decimal representation is mapped to a unique continued fraction by definition. Then $f \circ g$ is bijective.   \begin{equation*} \mathbb{N}^{\mathbb{N}} \equiv_c \mathbb{R} \end{equation*}
I noticed that all my decimal representations will be infinite. However, rational numbers have finite continued fraction expansions. Is there any way I could tweak my proof to account for this?
 A: I wouldn't bother with decimal expansions here.  If $\mathbb N$ means $\{1,2,3,\ldots\}$, then a function $f:\mathbb N\to\mathbb N$ corresponds to a smiple continued fraction
$$
f(1) + \cfrac{1}{f(2)+\cfrac{1}{f(3)+\cfrac{1}{\ddots}}}
$$
This gives a bijection from the set of all functions $f:\mathbb N\to\mathbb N$ to the set of all positive irrational numbers.  (Proving that it's one-to-one is something to think about.  As is proving that it's onto.)
Next you want a bijection from the set of all positive irrational numbers to the set of all positive real numbers.  After that, the function $\log$ is a bijection from the positive reals to all reals.
To find a bijection from the set of positive irrationals to the set of positive reals, I'd think about the fact that only countably many positive reals are rational.
A: If you want to see how your function is "hitting" Rationals, then you can use the fact that Rationals have a periodic expansion after a given term in their decimal representation. So the Rationals are the eventually-periodic functions, i.e., the functions that are periodic beyond a certain finite index $n_0$ .Then, for x rational $$x=0.a_1a_2...a_n=0.a_1a_2....a_{n_0}+P $$
where P is a periodic decimal that is 0 before $n_0$ and periodic beyond $P$, and $n_0 \geq 1 $.
As examples: $1/3 \rightarrow f: 3=f(0)=1=f(1)=.....$
$2/7 \rightarrow f:f(0)=1, f(2)=4, f(3)=2, f(4)=8, f(5)=5, f(6)=7 ; f(j):=f(j mod7)$
