\node (fi0j1) at (-0.75,  0.75) {$a$};
\node (fi0j0) at (-0.75, -0.75) {$b$};
\node (fi1j1) at (0.75,   0.75) {$c$};
\node (fi1j0) at (0.75,  -0.75) {$d$};

\draw[->,dotted] (fi0j1) -- (fi1j1) node[midway] (f) {f};
\draw[->] (fi0j0) -- (fi1j0) node[midway,below] (g) {g};
\draw[<-] (fi0j0) -- (fi0j1) node[midway,left] (p) {p};
\draw[<-] (fi1j0) -- (fi1j1) node[midway,right] (q) {q};