Where does require look for modules?

Related to this: A file containing a module with a name like Foo.Bar.Baz is placed in foo/bar/ and named baz.ex by convention, but there is nothing stopping you from doing it differently (except the very strong argument of confused coworkers).

Sometimes there are reasons for not following this convention though, for instance when having (for programmatic reasons) to define multiple modules in the same file.