It's not quite correct to ask for "the function", because if there is one then there are many. Moreover, explicit bijections are highly overrated. We can write one, but it's much much oh so much easier to use the Cantor-Bernstein theorem, and simply exhibit two injections.
If you do insist on writing an actual bijection, let me identify $\mathcal P(\Bbb N)$ with infinite binary sequences (which is quite standard). Now let me describe the steps. We would like to take a binary sequence to the real number in $[0,1]$ which has this binary string as an expansion. However some numbers, e.g. $\frac12=0.1\bar0_2=0.0\bar1_2$, one sequence with finitely many $1$'s and the other has finitely many $0$'s.
First enumerate all the strings which contain finitely many $0$'s the strings containing finitely many $1$'s. One can show that both sets are countably infinite, one can even enumerate them in a very nice way. Write them as $p_n$ for the $n$-th sequence with finitely many zeros and $q_n$ for the $n$-th sequence with finitely many $1$'s.
The next step is to take $f\colon2^\Bbb N\to2^\Bbb N$ defined as: $$f(x)=\begin{cases} q_{2k} & x=p_k\\ q_{2k+1} & x=q_k\\ x &\text{otherwise}\end{cases}$$ Easily this is an injection whose range is $2^\Bbb N\setminus\{p_n\mid n\in\Bbb N\}$.
Now map $x\in2^\Bbb N$ to $r\in[0,1)$ such that, $$r=\sum_{n\in\Bbb N}\frac{f(x)}{2^{n}}$$ that is the real number whose binary expansion is $f(x)$. One can show that this is a surjective function, since if a number has a binary expansion then it has one which has infinitely many $0$'s. It is also injective since if a real number one has two different binary expansions then we can show that exactly one of them has finitely many $0$'s and the other finitely many $1$'s. But since we use $f(x)$, this is impossible.
Find a bijection between $[0,1)$ and $\Bbb R$. Usually one does that by first "folding $0$ in" and having a bijection between $[0,1)$ and $(0,1)$ and then using something like $\frac{2x-1}{x(x-1)}$ or a similar function for a bijection with $\Bbb R$.
Using the Cantor-Bernstein theorem is much easier.
First note that that $\Bbb R$ can inject into $\mathcal P(\Bbb Q)$ by mapping $r$ to $\{q\in\Bbb Q\mid q<r\}$. Since $\Bbb Q$ is countable there is a bijection between $\cal P(\Bbb Q)$ and $\cal P(\Bbb N)$. So $\Bbb R$ injects into $\cal P(\Bbb N)$.
Then note that we can map $x\in2^\Bbb N$ to the continued fraction defined by the sequence $x$. Or to a point in $[0,1]$ defined by $\sum\frac{x(n)}{3^{n+1}}$, which we can show is injective in a somewhat easier proof.
Finally, as mentioned the last part is false. From the usual axioms of modern set theory (read: $\sf ZFC$) we cannot prove nor disprove that there are no intermediate cardinalities between $\Bbb N$ and $\Bbb R$. The proof of that is difficult and require a deep understanding of modern [read: axiomatic] set theory, as well logic.
If the last part somehow confused you, perhaps my answer to this question can help, Why is the Continuum Hypothesis (not) true?.
Incidentally, I don't think the OP has made the best case for non-duplicateness that they could, so let me do that here. Ignoring expansion issues, the point is the difference between their suggested map $$0.a_1a_2a_3...\mapsto \sum a_i\cdot 10^{i-1}$$ and the more common idea $$0.a_1a_2...a_n\mapsto \sum a_i\cdot 10^{n-i+1}.$$
Their suggestion makes much more sense - it really does look like a "limiting description" of something, the idea being that e.g. "$...333$" makes a lot more sense than "$333...$." This in turn makes their "$\mathbb{N}$ should be closed under limits of recursions" idea much more relevant, in my opinion, than it would otherwise be. I think this additional coherence is actually rather valuable, and makes this question meaningfully different - at least, from the potential duplicates I've been able to find.
J.W. Tanner's answer has gotten it exactly right: the expression "$3+30+300+...$" looks like a description of a natural number, but it isn't. There's an interesting subtlety here, though:
What exactly is $\mathbb{N}$?
This is one of those things which becomes less obvious the more we think about it, so it's worth analyzing a bit. The naive response is that natural numbers are finite - that's sort of the whole point - so we obviously can't have a natural number with an infinite number of digits. While this actually is perfectly right, it's also somewhat unsatisfying and may reasonably feel circular at first.
(Incidentally, this is why in my opinion it's much better to first present the diagonal argument for powersets: that for every set $X$ there is no surjection from $X$ to $\mathcal{P}(X)$. There's no need to define anything subtle here.)
All of what follows should really be a comment on J.W. Tanner's answer, but ... it's slightly too long.
So let's look at your query on this exact point:
isn't the nature of $\mathbb{N}$ precisely to be defined in an inductive way?
In the interests of brevity I'm not going to be totally formal in what follows, but I promise that no serious errors have been made.
"Defined in an inductive way" is a somewhat slippery thing to say, and it's created a crucial confusion in this case. In natural language we think of induction as a way of building more and more things, but that's not really the right picture. The rule
"$1$ is a natural number, and if $n$ is a natural number then $n+1$ is also a natural number"
isn't really about induction; it's really a "closure property," and that's a much simpler sort of thing. For example, it's also true that $1$ is a real number and if $n$ is a real number then $n+1$ is also a real number, but we wouldn't say that that amounts to the real numbers satisfying any kind of induction.
Rather, induction comes in when we say that the only way to build natural numbers is by applying the above rules. Specifically, consider the following very-clearly-limitative claim:
$(*)$ "$\mathbb{N}$ is the smallest set containing $1$ and closed under $n\mapsto n+1$."
The principle $(*)$ probably looks mysterious at first, but it's actually equivalent to the usually-phrased principle of induction.
Induction implies $(*)$: Suppose $X$ contains $1$ and is closed under $n\mapsto n+1$; we want to show $\mathbb{N}\subseteq X$. Well, consider $X\cap\mathbb{N}$. This set contains $1$ and is closed under $n\mapsto n+1$ (since both $X$ and $\mathbb{N}$ have these properties), so by applying induction in $\mathbb{N}$ we have $X\cap\mathbb{N}=\mathbb{N}$.
$(*)$ implies induction: Suppose $X\subseteq\mathbb{N}$ contains $1$ and is closed under $n\mapsto n+1$. Then by $(*)$ we have $\mathbb{N}\subseteq X$, so $X=\mathbb{N}$.
So when we say "$\mathbb{N}$ is built inductively," what we really mean is that $\mathbb{N}$ is as small as it could possibly be while satisfying some basic properties (namely, that $1\in\mathbb{N}$ and $\mathbb{N}$ is closed under $n\mapsto n+1$). Put another way:
Nothing is a natural number unless it absolutely has to be.
"OK," you might say, "but that's not what I think of natural numbers as! What if we replace $\mathbb{N}$ with some number system $\hat{\mathbb{N}}$ which does allow such infinite expressions?"
The good news is:
We can totally do this! The jargon here is "non-Archimedean discrete ordered semiring" or "nonstandard model of arithmetic" or something similar, but without diving into that let's just point out that we can totally whip up a perfectly well-behaved algebraic structure here.
The thing we get might indeed have the same cardinality as - or even be strictly bigger than - $\mathbb{R}$!
However, the drawback is that this is really mixing things up. We shouldn't compare the new $\hat{\mathbb{N}}$ to the old $\mathbb{R}$; e.g. what's the "$...3333$"th digit of $\pi$? Instead, we should compare $\hat{\mathbb{N}}$ to some $\hat{\mathbb{R}}$ which is the analogue of $\mathbb{R}$ for $\hat{\mathbb{N}}$. And once we whip up such a thing ... we'll see again that there is no surjection from $\hat{\mathbb{N}}$ to $\hat{\mathbb{R}}$.
Ultimately this takes us back to my parenthetical comment at the start of this answer: I think it's pedagogically better, most of the time, to present the fully general fact that every set is strictly smaller than its powerset before focusing on a particular example like $\mathbb{N}$ vs. $\mathbb{R}$, if for no other reason than that the general fact (once understood) makes the "goalpost-moving" issue above ("if we go from $\mathbb{N}$ to $\hat{\mathbb{N}}$ we should also go from $\mathbb{R}$ to $\hat{\mathbb{R}}$") basically unsurprising.
Best Answer
You have a bijection between the natural numbers and the integers, not between the natural numbers and the real numbers. The real numbers include $\frac12,\pi,\sqrt2$, etc. The first of these, $\frac12$, is a rational number; the last two are not.
There are bijections between $\Bbb Q$, the set of rational numbers, and $\Bbb N$, the set of natural numbers, but $\Bbb R$, the set of real numbers, is too big: one can prove that any function mapping $\Bbb N$ to $\Bbb R$ will miss some real numbers, and any function mapping $\Bbb R$ to $\Bbb N$ will hit some natural number infinitely many times.