\node (sq1_b00) at (-3, 1) {B};
\node (sq1_a10) at (-1, 1) {A};
\node (sq1_b01) at (-3, -1) {B};
\node (sq1_b11) at (-1, -1) {B};

\draw[dashed,->] (sq1_b00) -- node[midway] {g} (sq1_a10);
\draw[->] (sq1_a10) -> node[midway] {f} (sq1_b11);
\draw[->] (sq1_b00) -> node[midway,left] {1} (sq1_b01);
\draw[->] (sq1_b01) -> node[midway,below] {1} (sq1_b11);