Q:

Prolog member/2 predicate

Why does prolog answer false to: member([5], [2, 5]).?
Is there a way to work around it?
Any help will be greatly appreciated.

A:

Why does Prolog answer false to: member([5], [2, 5]).?

Let's ask Prolog why! Download library(diadem) into your working directory and:
?- use_module(diadem).
   true.

?- member([5], [2,5]).? Expl.
   Expl = member([_|_], [2, 5])
;  ...

Not only does it fail but also a generalization fails:instead of [5] that is a list with a single element 5, we have now simply at least one element - no matter which. So we can take the value for Expl as a query which still fails. Something in the remaining goal must thus be the culprit.
?- member([_|_], [2, 5]).
   false.

Note also what was not generalized away: The two elements are still here! If they would be variables, the query would succeed! Generalize the query a bit:
?- member([5], [2, Any]).
   Any = [5].

Now it succeeds!

A:

As described in the SWI Prolog documentation for member/2:

member(?Elem, ?List )
True if Elem is a member of List. 

The predicate is member. It is not subset or sublist or subsequence. It succeeds if the first argument is a member (that is, an element) of the list given in the second argument. The element [5] is not a member of the list [2, 5] since the element [5] isn't 2 and it isn't 5. However, [5] would be a member of the list [2, [5]], so member([5], [2, [5]]) would succeed. 

