If a graph with $n$ vertices and $n$ edges there must a cycle? How to prove this question? If a graph with $n$ vertices and $n$ edges it must contain a cycle?

Here's another approach:
Let $P = a_1, a_2, \dots, a_n$ be a simple path of maximal length in G. 
Since the degree of each vertex is greater than two, there exists a vertex $b$ such that ${b,a_1}$ is an edge. 
Now, there can be two cases:


*

*$b$ is on the path P: In this case, the sub-path from $a_1$ to $b$ and the edge from $b$ to $a_1$ forms a cycle.

*$b$ is not on the path P: In this case, the path $b,a_1,a_2, \dots, a_n$ is a path of greater length than $P$, thus contradicting our assumption.
Source
