TITLE: Cardinality of the set of all real functions of real variable
QUESTION [52 upvotes]: How does one compute the cardinality of the set of functions $f:\mathbb{R} \to \mathbb{R}$ (not necessarily continuous)?

REPLY [6 votes]: This answer is based on, but differs slightly from, user Asaf Karaglia's above. 

First, observe that by definition, $\{\text{all real functions of real variable}\}:=  \{f: \; f: \mathbb{R}\to\mathbb{R}\} := \mathbb{R}^\mathbb{R}$.
The question is about $|\{\text{all real functions of real variable}\}|$, so examine an arbitrary real function of real variable: $f\,\colon\,\mathbb{R}\to\mathbb{R}.$
 By inspection, $f\,\colon\,\mathbb{R}\to\mathbb{R} := \{(r, f(r)) : r \in  \mathbb{R}\} \quad \subseteq \quad P(\mathbb{R} \times \mathbb{R})$.
Thus, $\color{green}{|\mathbb{R}^{\mathbb{R}}| \le |P(\mathbb{R}\times\mathbb{R})|}$. 
Before continuing, let's try to simplify $|P(\mathbb{R}\times\mathbb{R})|$. Observe that   $|\mathbb{R}| = |\mathbb{R}^k| \, \forall \, k \in \mathbb{N}$. Its proof by mathematical induction requires the induction hypothesis of $|\mathbb{R}| = |\mathbb{R}^2|$, one proof of which is :  $|\mathbb{N}| = |\mathbb{N}\times\mathbb{N}| \implies |\mathbb{R}| = |2^{\mathbb{N}}| = |2^{\mathbb{N}\times\mathbb{N}}| = |2^\mathbb{N}\times 2^\mathbb{N}| = |\mathbb{R}\times\mathbb{R}|$.
Verily, $\mathbb{R} \neq \mathbb{R}^2$. Howbeit, for infinite sets $A,B$: $|A| = |B| \Longrightarrow  \require{cancel} \cancel{\Longleftarrow} |P(A)| = |P(B)|$.
(The converse is discussed here.)
Thus, $|P(\mathbb{R})| = |P(\mathbb{R}\times\mathbb{R})| \implies \color{green}{|\mathbb{R}^\mathbb{R}| \le |P(\mathbb{R}\times\mathbb{R})|} = |P(\mathbb{R})|$. Now scrutinise $|P(\mathbb{R})|$:   
● $\color{#A9057D}{|P(\mathbb{R})| = |2^{\mathbb{R}}|}$, where $2^{\mathbb{R}}  := \{f : \; f: \mathbb{R} \to \{0,1\}\}$,
● Every $f: \mathbb{R} \to \{0,1\}$ is a particular case of a function  from $\mathbb{R}$ to $\mathbb{R}$, thus $\color{#EC5021}{2^{\mathbb{R}} \subsetneq \mathbb{R}^\mathbb{R}}$.
Altogether, $\color{#A9057D}{|P(\mathbb{R})| =} \color{#EC5021}{|2^\mathbb{R}| \le} \color{green}{|\mathbb{R}^\mathbb{R}| \le |P(\mathbb{R}\times\mathbb{R})|} = |P(\mathbb{R})|$
$\implies |P(\mathbb{R})| \qquad \qquad \quad \leq |\mathbb{R}^\mathbb{R}| \leq |P(\mathbb{R})| \implies \color{#A9057D}{\underbrace{|P(\mathbb{R})|}_{= |2^\mathbb{R}|}} =  |\mathbb{R}^\mathbb{R}|  $.