We are given three points: \( (-a^2, 1, 1) \), \( (1, -a^2, 1) \), and \( (1, 1, -a^2) \), and the condition that the plane passing through these points also passes through the point \( (-1, -1, 1) \).
Step 1: To find the equation of the plane passing through the three given points, we can use the general form of the plane equation:
\[
Ax + By + Cz + D = 0
\]
Substitute the coordinates of the given points into the equation to find the values of \( A \), \( B \), \( C \), and \( D \).
Step 2: Substitute the coordinates of the point \( (-1, -1, 1) \) into the equation of the plane to find the condition for \( a \).
Step 3: Solving this equation, we find that the values of \( a \) that satisfy the condition are \( \pm \sqrt{3} \).
Thus, the set \( S \) is:
\[
S = \{\sqrt{3}, -\sqrt{3}\}
\]
% Final Answer
The set \( S = \{\sqrt{3}, -\sqrt{3}\} \).