Let $A = \textrm{diag}(a_{1},a_{2},a_{3})$ where $a_{1},a_{2},a_{3}$ are distinct. I am trying to show that every diagonal $3\times3$ matrix cane be made up of linear combinations of $I$, $A$ and $A^{2}$.
I was thinking of writing this matrix $$\begin{pmatrix} 1 & a_{1} & a_{1}^{2}\\ 1 & a_{2} & a_{2}^{2}\\ 1 & a_{3} & a_{3}^{2} \end{pmatrix}$$
and finding its determinant, then using to distinct value property to show that the determinant is non zero, but I didn't seem to get too far with that. I was wondering is there any other way I can approach this?
I think you have the right idea.
Firstly, the set of diagonal $3\times 3$ matrices constitutes a three-dimensional vector space.
Let $V$ be a three-dimensional vector space and let $\{e_1,e_2,e_3\}$ be a basis for $V$. If $v_1,v_2,v_3$ are elements of $V$, then the assertion that $\{v_1,v_2,v_3\}$ is a basis for $V$ is tantamount to the non-degeneracy of the matrix
$$\begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix}$$
if $v_j=\sum_{i=1}^{3} a_{ij} e_i$ is the expansion of $v_j$ in terms of the basis $\{e_1,e_2,e_3\}$.
Now, let us consider the specific case of $V$ being the three-dimensional vector space of diagonal matrices with "standard" basis
$$e_1=\begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{pmatrix}$$
$$e_2=\begin{pmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \\ \end{pmatrix}$$
$$e_3=\begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix}.$$
The matrix you wrote down
$$\begin{pmatrix} 1 & a_1 & a_1^2 \\ 1 & a_2 & a_2^2 \\ 1 & a_3 & a_3^2 \end{pmatrix}$$
is exactly the matrix you need to check for nondegeneracy. In fact, this matrix is the so-called Vandermonde matrix and is nondegenerate if and only if the $a_i$'s are distinct (which is the assumption that you have been given!). (The determinant of the Vandermonde matrix, i.e., the Vandermonde determinant, is $\prod_{1\leq i<j\leq 3} (a_j-a_i)$.)
Hope this helps!