Type inference example?

In my programming languages course we are reviewing type inference, i didnt get very well how to make this task. I all ready search at the bibliography of my course (PLAI by Shriram krishnamurthi) which actually sucks big cock since he jump lots of steps in the few examples he expose. Does anybody know how to make the type inference of the following function?:

(define(for-each f lst)
(if (not null? lst
(begin (f car lst for-each f
(cdr lst)))))

• Start with something simple, such as: what is the type of the function (define (f x) (+ x 3)). How do you know? What is the type of the function (define (comp f g) (lambda (x) (f (g x)))). How do you know? – Andrej Bauer May 26 '14 at 16:53
• probably it´s number since it´s a function application. When it´s an application it always return a number. Right? – newWithPython May 27 '14 at 4:25
• Hmmm, find someone to talk to live if you can. That would be my best suggestion. A site like this is better for clarifying minor points about something that you broadly understand. – Andrej Bauer May 27 '14 at 11:23