Hoffman and Kunze, Linear algebra sec 3.5 exercise 9 
Let $V$ be the vector space of all $2\times 2$ matrices over the field of real numbers and let $$B=\begin{pmatrix}2&-2\\-1&1\end{pmatrix}.$$
  Let $W$ be the subspace of $V$ consisting of all $A$ such that $AB=0.$ Let $f$ be a linear functional on $V$ which is in the annihilator of $W.$ Suppose that $f(I)=0$ and $f(C)=3,$ where $I$ is the $2\times 2$ identity matrix and $$C=\begin{pmatrix}0&0\\0&1\end{pmatrix}.$$
  Find $f(B).$

Attempt: Observing that $W=$ span$\{\begin{pmatrix}1&2\\0&0\end{pmatrix},\begin{pmatrix}0&0\\1&2\end{pmatrix}\}:=$ span$\{P,Q\}$ and $$B=(-1)P+(-1)Q+(3)I$$ 
we get $f(B)=(-1)f(P)+(-1)f(Q)+(3)f(I)=(-1)(0)+(-1)(0)+(3)(0)=0.$

The fact that I haven't used $C$ is bothering me. Is the matrix $C$ for display or is there anything wrong in what I have done?


There is nothing wrong with your solution. 
Perhaps the author had the following approach in mind for which $C$ could be useful. Also it helps to determine the functional completely. Let us consider the following standard basis of $V$:
$$\mathcal{B}=\{E_1,E_2,E_3,E_4\}=\left\{\begin{bmatrix}1&0\\0&0\end{bmatrix}, \begin{bmatrix}0&1\\0&0\end{bmatrix}, \begin{bmatrix}0&0\\1&0\end{bmatrix}, \begin{bmatrix}0&0\\0&1\end{bmatrix}\right\}.$$
Then 
$$E_1+C=I \implies f(E_1)=f(I)-f(C) \implies f(E_1)=-3.$$
Using your $P$ and $Q$ we get the following:
\begin{align*}
\because P=E_1+2E_2 && \implies &f(E_2)=\frac{3}{2}\\
\because Q=E_3+2E_4=E_3+2C && \implies &f(E_3)=-6
\end{align*}
We can express $B$ in terms of the vectors in the basis $\mathcal{B}$, therefore
\begin{align*}
B & = 2E_1-2E_2-E_3+E_4\\
f(B) & = 2f(E_1)-2f(E_2)-f(E_3)+f(E_4) && (\text{use }E_4=C)\\
f(B) & = 2(-3)-2\left(\frac{3}{2}\right)-(-6)+3\\
&=0.
\end{align*}
It further helps you identify the functional uniquely:
\begin{align*}
f\left(\begin{bmatrix}a&b\\c&d\end{bmatrix}\right) & = af(E_1)+bf(E_2)+cf(E_3)+df(E_4)\\
& = -3a+\frac{3b}{2}-6c+3d
\end{align*}
