If $g$ and $g\circ f$ are graded homomorphisms, must $f$ be graded?

Question

Let $A$ be a graded ring (always commutative with identity) and $M,N$ and $P$ be graded $A$-modules. Let $f:M \longrightarrow N$ and $g:N \longrightarrow P$ be $A$-module homomorphisms with $g$ being graded such that $g\circ f$ is graded. Is $f$ graded?

My thinking:

$\forall$ $m_k \in M_k$ with degree $k$. Therefore, $g\circ f(m_k) \in P_k$ since $g\circ f$ is graded. Suppose $f(m_k) = n_1 + \dots + n_r$ with $deg(n_i) = i$.

Therefore, $g\circ f(m_k) = g(n_1) + \dots + g(n_r)$. Because $g$ is graded, $deg(g(n_i)) = i$ for each $i$. We have $g(n_i) = 0$ if $i \neq k$.

That is, if $n_i \neq 0$ for some $i \neq k$ ,then $g(n_i) \neq 0$ (I think this statement has trouble...)

-
Is the main problem that $g$ may not be injective? – Peter Hu May 29 '12 at 5:35
I think that statement is not true definitely, but I can't find a concrete counterexample. – Peter Hu May 29 '12 at 5:40

The answer is negative: take $f$ arbitrary and $g=0$.