I would like to know if my attempt is correct.
Let $f: \mathbb{R}^2 \longrightarrow \mathbb{R}$ differentiable and $(x_n,y_n,f(x_n,y_n)) \subset \mathbb{R}^2 \times f(\mathbb{R}^2)$. As $\mathbb{R}^2$ is complete as metric space, there exists $(x,y) \in \mathbb{R}^2$ such that $(x_n,y_n) \rightarrow (x,y)$. Consequently, $f(x_n,y_n) \rightarrow f(x,y)$ from the continuity of $f$. Thus, $(x_n,y_n,f(x_n,y_n)) \rightarrow (x,y,f(x,y)) \in \mathbb{R}^2 \times f(\mathbb{R}^2)$, i.e., $\mathbb{R}^2 \times f(\mathbb{R}^2)$ is closed, then $\mathbb{R}^2 \times f(\mathbb{R}^2)$ is a closed submanifold of $\mathbb{R}^3$, therefore it is geodesically complete. $\square$
Thanks in advance!
Your attempt is not correct (as explained in the comments), but there's no need for all that. It's a standard general topology exercise that the graph of a continuous function $f: X \to Y$ is closed in $X \times Y$ if $Y$ is Hausdorff. Since $\mathbb{R}$ is Hausdorff, it follows that the graph of a differentiable real function is closed and therefore complete (since $\mathbb{R}^n$ is always complete) by Hopf-Rinow.