Prove that every graph in which each vertex has degree at least 2 must contain a cycle.
This was my idea behind it but wasn't sure if I was on right track and how to move forward
If a graph is a tree with n >= 2 vertices , it has at least two vertices of degree one.
Contrapositive: if a graph with n>=2 vertices does not have at least two vertices of degree one, it is not a tree.
Consider a path of the maximum length possible, let it be $a_1,a_2,\dots, a_k$.
Since the path is of maximum length all of the neighbours of $a_1$ are in the path (otherwise there would be a longer path $x,a_1,\dots, a_k$ where $x$ is another neighbour of $a_1$.
Since the degree of $a_1$ is more than $1$ there is a vertex $a_j$ with $j>2$ that is connected to $a_1$.
Thus $a_1,a_2,\dots,a_k,a_1$ is the desired cycle.