How can I do this?
For each integer $a> 1$, $σ (a)$ is the smallest prime number dividing $a$. Fix
$$S := \{10, 11, 12,. . . , 24, 25\}$$
Consider the equivalence relation $R$ defined in $S$ placing
$$a R b \Leftrightarrow σ (a) = σ (b).$$
Find the partition of $S$ identified by $R$
My attempt:
$\{\{10,12,14,16,18,20,22,24\},\{15,21\},\{25\},\{11\},\{13\},\{17\},\{19\},\{23\}\}$
If the least prime factor of $n$ is $\ge 7$ and $n$ is composite then $n\ge 7^2=49$. Hence, we have to consider as representative elements only: prime numbers, and the ones with least prime factors $2,3,$ and $5$ (let's us say $A,B,C$, respectively). Then $$ A=\{10,12,14,\ldots,24\}, B=\{15, 21\}, \text{ and } C=\{25\}. $$ To these three classes, we should add: $$ \{11\}, \{13\}, \{17\}, \{19\}, \text{ and } \{23\}. $$
Conclusion: your attempt is correct.