1. We play basketball in the gym.

2. We play basketball at the gym.
3. We play soccer on the playground.
4. We play soccer in the playground.
5. We play soccer at the playground.
6. He is playing in the room.
7. He is playing at the room.
[Can we use all the prepositions? What about #7? Do we have to use only 'in' before 'the room'?]

I would not use 4 or 7. The others are OK.

In English, the use of prepositions can vary depending on the specific context and the location being referred to. Let's take a closer look at each sentence:

1. We play basketball in the gym. ✔️
The preposition "in" is commonly used to indicate that an activity takes place inside a specific enclosed space, like a gymnasium.

2. We play basketball at the gym. ✔️
The preposition "at" is also acceptable here and suggests that the activity of playing basketball occurs in the vicinity of the gym, but not necessarily inside it.

3. We play soccer on the playground. ✔️
The preposition "on" is frequently used to describe an activity happening outdoors, typically on a specifically designated area like a playground.

4. We play soccer in the playground. ✔️
Similar to the previous example, the preposition "in" can be used to indicate playing soccer within the boundaries of the playground, emphasizing being enclosed within its area.

5. We play soccer at the playground. ✔️
In this sentence, the use of "at" suggests that the soccer playing occurs near the playground, perhaps in the vicinity of it, but not necessarily inside it.

6. He is playing in the room. ✔️
The preposition "in" is suitable here because it implies that the person is engaged in playing inside a specific room.

7. He is playing at the room. ❌
Although "at" can be used in various contexts, it is not typically used to describe playing inside a room. The correct preposition to use in this case is "in."

In summary, for the specific examples provided, "in" is the most common preposition to use before "the gym" and "the room," while "on" and "at" can both be used before "the playground," depending on the intended meaning of location.