Has it been legal for my mother to collect my step father's death benefits while living with someone
The answer will depend on all the facts and circumstances involved. For example, if they are claiming to be a married couple in order to receive benefits, it is possible a fraud claim may be brought. Fraud involves a knowingly made misrespresentation that is intended to cause another to rely and act on it to their harm. Proof of intentional wrongdoing is required to convict on a criminal charge. There are also civil fraud claims that may be raised, when the intent is to recover money lost rather than punish for wrongdoing. It is possible for a statute of limitations to be tolled (suspended) when fraud prevents the discovery of the injury, so that the statutory time doesn't begin to run until the injury is discovered.
It is not illegal for a person to cohabit with another while receiving benefits of a former spouse. Cohabitation alone doesn't disqualify a person from widow's benefits. It is not uncommon for elderly couples to stay unmarried in order to not lose eligibility for financial benefits.