Restricting $p$ to the unit square is a surjective continuous map which is injective on the interior. So you can specify this map just by figuring out how the edges are identified. For each edge, which $f_{n,m}$ map it to another edge of the unit square? Does it reverse orientation or not?
I'm not sure what the best source is but I learned this in a class where our texts were Munkres and Hatcher.