I am told:
Let
$$\varphi : M_{2\times 2}\to\mathbb R $$ $$ A \mapsto\operatorname{trace}(A) $$
Compute the matrix of this linear map with respect to the canonical basis of $M_{2\times 2}$ and $\{1\}$.
If we plug the elemnts of the canonical basis into the map we get the following:
$$\varphi\left(\begin{bmatrix} 1 & 0 \\0 & 0\end{bmatrix}\right)= 1$$ $$\varphi\left(\begin{bmatrix} 0 & 1 \\ 0 & 0\end{bmatrix}\right)= 0$$ $$\varphi\left(\begin{bmatrix} 0 & 0 \\1 & 0 \end{bmatrix}\right)= 0$$ $$\varphi\left(\begin{bmatrix} 0 & 0 \\0 & 1 \end{bmatrix}\right)= 1$$
However, I don't know what's the size of the resulting matrix representation. In other words, should I arrange my resulting scalars as a $2\times 2$ matrix or something different?
Thank you in advance!
You have that $\varphi$ is linear, so $\varphi\in Hom_\mathbb{R}(M_{2\times 2}(\mathbb{R}),\mathbb{R})$, so $\left[\varphi\right]\in M_{1\times 4}(\mathbb{R})$ (i.e. it is a row-vector roughly speaking) being $\dim_\mathbb{R}M_{2\times 2}(\mathbb{R})=4$, as you noticed by taking the canonical basis. Here one could be confused by the "transformation" of matrices into vectors, but just note that if $V$ is an $\mathbb{R}$-vector space then a choice of a $\mathcal{B}$ base of $V$ gives you an isomorphism of vector spaces $[·]_\mathcal{B}:V\longrightarrow\mathbb{R}^{\left|\mathcal{B}\right|}$