Answer
$(2,2)$
Work Step by Step
Point on line $y = x$ closest to point $(3, 1)$
Let point (x, x) on line $y = x$ be closest to point $(3, 1)$
Distance between points $d(x) = \sqrt{(x-3)^2+(x-1)^2)}$
$\Rightarrow d(x)^2 = 2x^2 -8x +10$
Minimum value of $d(x)$ or $d(x)^2$ at the vertex of the parabola
Vertex at $x = \frac{-b}{2a} = 2$
And value $d(x)^2 = 2$
So point on line $ y = x$ nearest to point $(3, 1)$ is $(2,2)$