Set of all functions $f:\mathbb R\to \mathbb R$ that are non-zero only finitely many times I am looking for cardinality of set $S=\{f:\mathbb R\to \mathbb R\mid f(x)\not=0, \text{only in finitely many $x \in \mathbb R$}\}$.
My hunch tells me it is only uncountable. Obviously $F:\mathbb R\to S$ given by:
$$F(x)(t)=f_x(t)=\begin{cases}x,&t=1,\\0, & t \not = 1\end{cases}$$
is a well defined injection.
For other injection, I thought of mappings such as:
$$f \mapsto\left(\sum_{f(x)\not = 0}e^x,\sum_{f(x)\not = 0}e^{|x|},\sum_{f(x)\not =0}e^{-x},\sum_{f(x)\not = 0}f(x),\prod_{f(x)\not = 0}f(x)\right)$$
but I am not sure if $f$ is an injection or not. Any hint would be appreciated.
 A: Note that your set $S$ is nothing but the union
$$S=\bigcup_{F\in\mathcal{F}}\{f\colon\mathbb{R}\to\mathbb{R}:f|_{\mathbb{R}\setminus F}\equiv 0\}$$
where $\mathcal{F}$ is the family of all finite subsets of $\mathbb{R}$. For given $F$, the set $\{f\colon\mathbb{R}\to\mathbb{R}:f|_{\mathbb{R}\setminus F}\equiv 0\}$ has the cardinality $|\mathbb{R}^{F}|$, which is equal to the cardinality of $\mathbb{R}$ since $F$ is a finite set. Now, $\mathcal{F}$ is nothing but the union
$$\mathcal{F}=\bigcup_{n=1}^{\infty}\{S\subseteq\mathbb{R}:|S|=n\},$$
where for each $n$ the cardinality of the set $\{S\subseteq\mathbb{R}:|S|=n\}$ is $|\mathbb{R}^{n}|$, which is again equal to the cardinality of $\mathbb{R}$. Countable union of sets of caridnality $|\mathbb{R}|$ is of cardinality $|\mathbb{R}|$, so the set of all finite subsets of $\mathbb{R}$ has the cardinality equal to $|\mathbb{R}|$. Therefore, $S$ is a union, over a family $\mathcal{F}$ whose cardinality is $|\mathbb{R}|$, of sets of cardinality $|\mathbb{R}|$, thus we should have $|S|=|\mathbb{R}|$.
A: Such a function can be "encoded" by a finite sequence of reals, namely the places where $f\ne0$ and the values there. The set of such finite sequence has same cardinality as $\Bbb R$.
A: Your injection $\Bbb{R} \to S$ implies $|S| \ge \mathfrak{c}$.
Define an injection $$S \to \bigcup_{A\subseteq \Bbb{R}\text{ finite}} (\Bbb{R}\setminus \{0\})^A$$
which maps $f \in S$ to a function $$\{x \in \Bbb{R} : f(x) \ne 0\} \to \Bbb{R}\setminus\{0\}, \quad x \mapsto f(x).$$
The latter set is
$$\bigcup_{A\subseteq \Bbb{R}\text{ finite}} (\Bbb{R}\setminus \{0\})^A = \bigcup_{n=0}^\infty \bigcup_{A\subseteq \Bbb{R},\,|A|=n} (\Bbb{R}\setminus \{0\})^n.$$
There are $\mathfrak{c}$ subsets of $\Bbb{R}$ with cardinality $n$, and $|(\Bbb{R}\setminus \{0\})^n| = \mathfrak{c}^n = \mathfrak{c}$
so
$$|S| \le \aleph_0 \cdot \mathfrak{c}\cdot \mathfrak{c} = \mathfrak{c}.$$
We conclude $|S|=\mathfrak{c}$.
