The phrasing in your question is a little awkward since the question asks for $\oint$, which is a line integral, and states that "where integration is done under area," which sounds like an area integral.
Breaking the triangle into its three edges, we can construct the paths:
\begin{align}
\gamma_1(t)&=t\\
\gamma_2(t)&=(1-t)+ti\\
\gamma_3(t)&=(1-t)i.
\end{align}
Then $\gamma_1$ is the path from $0$ to $1$, $\gamma_2$ is the path from $1$ to $i$, and $\gamma_3$ is the path from $i$ to $0$ (each path has domain $[0,1]$).
Then, since
\begin{align}
\gamma_1'(t)&=1\\
\gamma_2'(t)&=-1+i\\
\gamma_3'(t)&=-i,
\end{align}
we can substitute these into a line integral to get
\begin{align}
\oint\Im(z^2)dz&=\int_0^1 \Im(t^2)\cdot 1dt\\&+\int_0^1 \Im(((1-t)+ti)^2)\cdot(-1+i)dt+\int_0^1\Im(((1-t)i)^2)\cdot(-1)dt
\end{align}
In the first and third integrals, the argument to $\Im$ is real, so the integrand in these cases is $0$. This leaves the second integral:
$$
\int_0^1 \Im(((1-t)+ti)^2)\cdot(-1+i)dt=(-1+i)\int_0^1\Im((1-2t)+2t(1-t)i)dt.
$$
We can simplify this to
$$
(-1+i)\int_0^12t(1-t)dt=2(-1+i)\left.\left(\frac{t^2}{2}-\frac{t^3}{3}\right)\right|_0^1=2(-1+i)\frac{1}{6}=\frac{1}{3}(-1+i).
$$