I was wondering if anybody could help with this exercise from my graph theory lecture notes. Intuitively it seems fairly clear to me that what I want to show must be true, however I am rather unfamiliar in proofs involving modules as they were only introduced to me in this course.
I attempted considering a vertex of degree at least $2$ belonging to $U$ and considering its neighbours but unfortunately I wasn't able to progress very far, any help would be appreciated thanks!
Relevant definitions:
Let $U = \{u_1, u_2, \dots\}$ be a module in a graph $G$ and let $W = \{w_1, w_2, \dots\}$ be the set of vertices in $V(G) \setminus U$ adjacent to the vertices of $U$. The module is trivial if $U = \varnothing$ or $|U|=1$ (when there's nothing to check), and also if $W = \varnothing$ (when $U$ induces a connected component of $G$ - the whole graph, in the case of a tree).
There are two cases in which a cycle appears (you should draw out the graph with $U$, $W$, and the edges between them and check this):
If we're in a tree, then neither of these can happen. So the only remaining possibility for a nontrivial module is $|W|=1$ and $U$ is an independent set. You should check that in this case, every vertex of $U$ has degree $1$.