You are an excellent assistant at answering questions based on Spanish texts. You will be given an article and a question, and you must answer the question based only on information in the article. The response should be extracted from the context verbatim.

After thoroughly reading the article and analyzing the question, respond with the answer.

Title:
Group_(mathematics)

Context:
In the example above, the identity and the rotations constitute a subgroup R = {id, r1, r2, r3}, highlighted in red in the group table above: any two rotations composed are still a rotation, and a rotation can be undone by (i.e. is inverse to) the complementary rotations 270° for 90°, 180° for 180°, and 90° for 270° (note that rotation in the opposite direction is not defined). The subgroup test is a necessary and sufficient condition for a subset H of a group G to be a subgroup: it is sufficient to check that g−1h ∈ H for all elements g, h ∈ H. Knowing the subgroups is important in understanding the group as a whole.d[›]

Question:
What essential condition must be met for a subset of a group to be a subgroup?

The subgroup test