Equivalent condition to $M_1 \cong M_2 \times M_3$ in a short exact sequence of modules. 
Let $0 \rightarrow M_2 \xrightarrow{f} M_1 \xrightarrow{g} M_3 \rightarrow 0$ be a short exact sequence of modules. Prove that $M_1 \cong M_2 \times M_3$ if and only if there exists homomorphisms $\phi \colon M_1 \to M_2$ and $\psi \colon M_3 \to M_1$ such that $f \circ \phi + \psi \circ g = \mathrm{Id}_{M_1}$.

It looks like splitting lemma, but is a weakest condition. How I can prove this?
 A: Here's a counterexample with $\Bbb Z$-modules:
Let $M_3=\bigoplus_{n\in\Bbb N}\Bbb Z/2\Bbb Z$ and $M_1=M_2=\Bbb Z\oplus M_3$.
Then by a Hilbert hotel argument, one readily sees that $M_2\cong M_1\oplus M_3$.
Now let  $$f(a_0,a_1+2\Bbb Z, a_2+2\Bbb Z,\ldots) = (2a_0,a_1+2\Bbb Z, a_2+2\Bbb Z,\ldots) $$ and $$g(a_0,a_1+2\Bbb Z, a_2+2\Bbb Z,\ldots)=(a_0+2\Bbb Z,a_1+2\Bbb Z, a_2+2\Bbb Z,\ldots),$$
which gives us the short exact sequence. But there cannot exist $\phi,\psi$ such that  $f\circ \phi+\psi\circ g$ is the identity. Indeed, $(1,0+2\Bbb Z,\ldots)$ is impossible to reach.
A: Composing by $g$ on the left, it follows $(g \circ \psi-id) \circ g=0$. As $g$ is onto, we get $g \circ \psi=id$, ie $\psi$ is a section. Similarly, $\phi \circ f=id$.
We have morphisms $\alpha=(\phi,g): M_1 \rightarrow M_2 \times M_3$ and $\beta=f \oplus \psi: M_2 \times M_3 \rightarrow M_1$ with $\beta \circ \alpha=id$. Let $x \in M_2,y \in M_3$ be such that $\beta(x,y)=0$. Then $f(x)=-\psi(y)$. So $-y=-g \circ \psi(y)=g \circ f(x)=0$. So $y=0$ so $f(x)=0$ so $x=0$ and $\beta$ is injective.
Thus $\alpha$ and $\beta$ are inverse isomorphisms.
