I find this exercise is interesting. Here's my solution:
(define (my-equal? a b)
(cond ((eq? a b) #t)
((and (pair? a) (pair? b))
(and (my-equal? (car a) (car b)) (my-equal? (cdr a) (cdr b))))
(else #f)))
Is it right ? I wonder if (eq? a b) is true, (equal? a b) should be always true.
I think we can give a more accurate answer by considering other data types, and recursively testing the elements in proper/improper lists. Here's my shot:
For the last part of your question, I suggest you take a look at this very detailed answer.