Understanding the canonical basis for $Func(\mathbb{N}, \mathbb{C})$ My textbook, "Quantum Computing for Computer Scientists," gives the following example:

$Func(\mathbb{N}, \mathbb{C})$: The canonical basis is composed of a
countably infinite number of functions $f_j (j = 0, 1, 2, ...)$, where
$f_j$ is defined as

$\begin{equation}
f_j(n)=
    \begin{cases}
        1 & \text{if } j = n\\
        0 & \text{otherwise } 
    \end{cases}
\end{equation}$

It's not hard to see that any function $f \in Func(\mathbb{N, C})$
can be written as the sum $f = \sum_{j = 0}^\infty c_j \cdot f_j$ where $c_j = f(j)$. It is also not hard to see that these functions are linearly independent. Hence they form a basis for $Func(\mathbb{N, C})$.

I'm having a hard time understanding how this basis works and how to represent functions with it. For example, I came up with a few functions $f,g, h \in Func(\mathbb{N, C})$,
$f(n) = cos(n)$,
$g(n) = e^n$, and
$h(n) = n^2 + n + 1$.
I don't get how I would write these functions in terms of the canonical basis.

FYI a common notation that essentially does the same thing as these basis vectors is the “Kronecker Delta” (sometimes confused with the very similar Dirac Delta) notation: $$\delta_{i\,j}=\begin{cases}0&i\neq j\\1&i=j\end{cases}$$Over integer indices (usually) $i,j$.
I recommend you re-read the text concerning the nature of the $c_j$. For example, we can expand $f(n)=\cos n$ as: $$n\mapsto\sum_{j=0}^\infty\cos(j)f_j(n)$$I think the best way to realise they are the same function is to manually check. Plug in a value of $n$, maybe keep it concrete and choose $n=1,2$, say, and see what happens. For another example: $$h(n)=\sum_{j=0}^\infty(j^2+j+1)f_j(n)$$
In the sum, the only value which is nonzero is the value at $j=n$, where we get: $$c_j\cdot(1)=c_j=h(j)=h(n)$$As desired, since you can ignore the zero-values.
