Let $G$ be a graph such that all its vertices have degree 2. Prove that $G$ is a union of pairwise disjoint cycles. 
Let $G$ be a graph such that all its vertices have degree 2. Prove that
$G$ is a union of pairwise disjoint cycles.

This is Exercise 4.1.4 in the book Problem-Solving Methods in Combinatorics by Pablo Soberón.
Since exercises do not have any solutions in the book, I came here to ask for help.
I was thinking of using mathematical induction, since most basic graph properties I saw can be proven using induction. So let's induct on the number of vertices the graph has.

*

*Base case: if the graph has one vertex, then the problem is obvious (the graph must be a loop, which is a cycle)

*Induction step: I don't have any ideas how to do this. I was thinking of considering a subgraph $G'$ that has less than $n$ vertices and also all of its vertices have degree 2.

Please help me! Thank you in advance!

Hint. Consider a connected component $C$ of $G$. Then the vertices of $C$ have degree $2$. Show that $C$ is a cycle. Note that, more generally, any connected graph with all even degree vertices have an Eulerian circuit.
