The error you made is that you wrote a dot (.) at the end of member(M, Y). this means that Prolog thinks that you wrote:
contained(X, Y) :-
member(M, Y). %% notice the dot (.) here
select(M, Y, X).
So you here defined contained(X, Y) as member(M, Y) and furthermore you implemented a predicate named select(M, Y, X) that is always true for all values for M, Y and X.
You can replaced the . with a comma (,) here:
contained(X, Y) :-
member(M, Y),
select(M, Y, X).
That being said, you do not need member/2 here. In fact by using member, if the list contains duplicate values, it will result in yielding the same list multiple times.
You can just use select/3 [swi-doc] here with a wildcard (_) on the item to remove:
contained(X, Y) :-
select(_, Y, X).
or we can use explicit recursion:
contained(T, [_|T]).
contained([H|T1], [H|T2]) :-
contained(T1, T2).
select/3does? - Willem Van Onsem