Q:

How to remove all the duplicates in a list using scheme (only abstract list functions allowed)

I know how to write this in an recursive way.  
(define (removed2 lst)
  (cond
       [(empty?  lst) empty]
       [(not (member? ( first lst) (rest lst)))
        (cons (first lst) (removed2 (rest lst)))]
       [else (removed2 (rest lst))]))

so (removed2 (list 1 1 1 2 2 2 3 3 3 3 3 3)) gives (list 1 2 3)
However, how do you rewrite it only using abstract functions (filter, foldr, map, and build-list)?  
I tried to use filter but it just doesn't work. 

A:

It's possible to use foldr for this, the trick is knowing what to write in the lambda:
(define (removed lst)
  (foldr (lambda (e a)
           (if (not (member?  e a))
               (cons e a)
               a))
         '()
         lst))

Also check if your interpreter has a built-in function, for instance in Racket you can use remove-duplicates.