I'm reading Nick Weaver's Forcing for Mathematicians and in Chapter 12 ("Forcing CH") he starts with this (pg 45 - 46):
(Everything here is relativized to $M$ - which in his book is a model of ZFC).
Let $P_1$ be the set of all partial functions from $\mathcal{P}(\mathbb{N})$ to $\aleph_1$ (which is a forcing notion) and let $G$ be a generic ideal of $P_1$. Since the elements of $G$ are functions that must be consistent (since $G$ is an ideal) you can take the union of them to construct a function $\tilde{f}$ from a subset of $\mathcal{P}(\mathbb{N})$ to a subset $\aleph_1$.
He then proves that:
- $\tilde{f}$ is a bijection (not just a function) from a subset of $\mathcal{P}(\mathbb{N})$ to a subset $\aleph_1$ since patching consistent bijections together gives you a bijection.
- The domain of $\tilde{f}$ is all of $\mathcal{P}(\mathbb{N})$ since $G$ is generic.
- The range of $\tilde{f}$ is all of $\aleph_1$ since $G$ is generic.
A far as I can tell therefore, given any model $M$ of ZFC (i.e. any set for which ZFC holds), there is a bijection from $\mathcal{P}(\mathbb{N})$ to $\aleph_1$ and therefore the continuum hypothesis is true.
I know he goes on to talk about $M[G]$ but, as far as I can tell, any $M[G]$ is just another model of ZFC and could very well have been the set we picked for $M$.
But the bijection $\widetilde f$ is not in $M$, that's the whole point. It is in $M[G]$. What you've shown is merely that for every model of $\sf ZFC$, there is a larger model in which $\sf CH$ is true.
To see that indeed $\widetilde f\notin M$, note that given any function $g\colon \mathcal P(\Bbb N)\to\omega_1$, there is a dense set of conditions $p$ such that $p\nsubseteq g$. Therefore by genericity, $\widetilde f\neq g$. If $\widetilde f$ is not equal to any function in $M$, then it cannot be in $M$.
(This is, more broadly, the reason why whenever a forcing is nontrivial, there are no generic filters in the ground model.)