The coordinates of
\(D \text{ and } D'\) are at
\((0,0),\) tells you that the line of reflection passes through
\((0,0).\)
Connect point
\(C \text{ to } C'\) with a line. The line of reflection is the perpendicular bisector of
\(C \text{ and } C'.\)
From the properties of reflection, the distance from the object to the mirror line is the same as that of mirror line to the image. Therefore, the line of reflection passes through the midpoint of the line connecting
\(C \text{ to } C'.\)
Coordinates for \(C \text{ is }(4,2)\) and that of \(C' \text{ is } (-2,-4).\) The mid point of line \(CC'\) is:
\begin{equation*}
\left( \frac{4 + -2}{2},\frac{2 + -4}{2} \right) = (1,-1)
\end{equation*}
Since you know that the line of reflection passes through \((0,0) \text{ and } (1,-1),\) the gradient of the reflection line is:
\begin{equation*}
m = \frac{-1 - 0}{1 - 0} = -1
\end{equation*}
Therefore taking points \((x,y) \text { and } (1,-1),\) the equation of the line of reflection is :
\begin{equation*}
y - y_1 = m (x - x_1)
\end{equation*}
\begin{equation*}
y - -1 = -1 (x - 1)
\end{equation*}
\begin{equation*}
y + 1 = -x + 1
\end{equation*}
\begin{equation*}
y = -x
\end{equation*}