Lets say we have a predicate that returns true if there is a member in a list. False if not. In prolog I ended up with a code like below
member(B,[B|_]).
member(B,[_|A]):- member(B,A).
Its true for member(1,[3,1,2]). and false for member(1,[4,5,6]). How to use FOL to represent the above function?
In first order logic you might want to use a predicate and not a function to represent your function. If $F$ is a $n$-ary function in a FOL, then if $X_1,\ldots,X_n$ are terms of your language $F(X_1,\ldots,X_n)$ will again be a term. For example, $+(X_1,X_2) \colon = X_1+X_2$ represents the sum function in PA.
Now, $X_1 \in X_2$ is not a term! It's a first-order formula (a thing that you want to put a truth value). When you want $F(X_1,\ldots,X_n)$ to represent a formula (and receive a truth value), then $F$ must be a predicate symbol.
In your case, member$(X_1,X_2) \colon = X_1 \in X_2$