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 is an approach which does not use induction:
Let $G$ be a graph with $n$ vertices and $n$ edges.
Keep removing vertices of degree $1$ from $G$ until no such removal is possible, and let $G'$ denote the resulting graph. Note that in each removal, we're removing exactly $1$ vertex and $1$ edge, so $G'$ cannot be empty, otherwise before the last removal we'd have a graph with $1$ vertex and $1$ edge, and $G'$ has the same number of vertices and edges.
Therefore the minimum degree in $G'$ is at least $2$, which implies that $G'$ has a cycle.
