You want to use Where instead of Select.
Where returns everything that matches the supplied lambda expression.
Select is a transformation. It transforms each element using the supplied lambda expression.
Additionally, Where returns an IEnumerable<T>, because it can't know that only one element will match your condition. If you know it will only return one result, append Single to the query, to return only one element. Only then it will compile:
GroupSet groupToChange = context.GroupSet.Where(q => q.groupId == groupId)
.Single();
If you are unsure, whether or not one element will match, use SingleOrDefault:
GroupSet groupToChange = context.GroupSet.Where(q => q.groupId == groupId)
.SingleOrDefault();
The difference between those two:
Single will throw an exception, if the result set of Where is empty.
SingleOrDefault will return default(T), i.e. null in your case.