A module as an external direct product of the kernel and image of an idempotent function
Solution 1:
Summary
The internal direct sum is a relationship between submodules of a module that mirrors the external direct product. These two notions, in a sense, subsume each other.
Details
The (external) direct sum of two modules joins them into a single module while keeping copies of the original two modules which don't overlap.
So for example, if $A$ and $B$ are modules, then $A\oplus B$ is $A\times B$ with the usual module structure. Notice this module has two submodules $\bar{A}=A\times\{0\}$ and $\bar{B}=\{0\}\times B$ isomorphic to $A$ and $B$ respectively. Notice also that $\bar{A}+\bar{B}=A\times B$ and $\bar{A}\cap \bar{B}=\{0\}\times\{0\}$.
"Internal direct sums" are kind of like the inverse of that problem. Given a module $M$, are there submodules $A,B$ which only meet at $0$ and $A+B=M$? In this way, external direct sums can be though of as a type of product, and finding internal direct sums is just "factoring" with that product.
How they are interrelated
The external direct sum $A\oplus B$ of $A$ and $B$ is an internal direct sum of $\bar{A}$ and $\bar{B}$. In that sense, external direct sums are internal direct sums.
In the other direction, if $N$ and $N'$ are submodules of a module $M$ such that $N+N'=M$ and $N\cap N'=\{0\}$, then you can prove that $N\times N'$ with the direct sum module structure is isomorphic to $M$ via the mapping $(n,n')\mapsto n+n'$. Notice how the mapping lines up the submodule $N\times\{0\}\subseteq N\times N'$ with $N\subseteq M$ and likewise for $N'$. In this sense, internal direct sums as external direct sums.
I don't mean to say they are identical ideas, because they are obviously not. What I mean to say is that an internal direct sum is just a reflection of an external direct sum interpreted inside a module.
Your situation
Really, I think your proof is fine, and I'm not sure your teacher is actually looking for you to distinguish it as an external direct sum. But if you want to, you can: just form the external direct sum of the modules $\ker(f)$ and ${\rm im}(f)$, and map $A$ into this direct sum by sending $a\mapsto (a-f(a),f(a))\in\ker(f)\times{\rm im}(f)$, explaining that this is an isomorphism.