We say that a homomorphism $f\colon G\to K$ "factors through" another homomorphism if one can write $f$ as a composition using that homomorphism.
For example, if $f\colon G\to K$ "factors through" $\pi\colon G\to H$, that means that there exists a homomorphism $u\colon H\to K$ such that $f = u\circ\pi$. The reason we call it "factors through" is that if you write composition of functions by simple juxtaposition, you get $f=u\pi$, which suggests that $\pi$ "divides" $f$, or that you can "factor" $f$ into a "product" in which one of the factors is $\pi$.
What the question is asking you to do is show that if $\phi\colon G\to A$ is a homomorphism from $G$ into an abelian group, then the homomorphism $\phi'\colon G/G' \to A/A'$ that is induced by $\phi$ (which is given by the formula $\phi'(gG')=\phi(g)A'$) satisfies $\phi(x) = \phi'(\pi(x))$ for all $x\in G$ (that is, that the function $\phi$ is the same as the function $\phi'\circ\pi$).
(I am assuming you have already shown that if $f\colon G\to K$ is a group homomorphism, then $f'\colon G/G'\to K/K'$ given by $f'(gG') = f(g)K'$ is a well-defined group homomorphism; if you haven't, then you need to do it!)
You got started correctly: technically, $\phi'\circ\pi$ cannot equal $\phi$, because the codomain of $\phi$ is $A$, while the codomain of $\phi'\circ\pi$ is $A/A'$. So your first step, showing that $A'$ is trivial, was great. That means that $A/A'$ is "really" (canonically) the same thing as $A$, so that you can consider $\phi'$ as being a map $\phi'\colon G/G'\to A$; thus, $\phi'$ "can be thought of" as given by $\phi'(gG') = \phi(g)$. So then you just need to verify the two functions, $\phi$ and $\phi'\circ\pi$, are equal.
The fact that every element of $G'$ maps to the trivial element of $A$ is important to show that $\phi'$ is well-defined, but if you already know that it is well-defined, then you don't need it.
Suppose $p$ is odd. Consider the kernel of $\phi$ in the second fact. It consists exactly of the elements of order dividing $p$, and so there are either $p^2$ or $p^3$ of these; always more than $p$. However, by the first fact, there are exactly $p$ central elements of order dividing $p$. In particular, for every odd prime $p$ and non-abelian $p$-group $G$, there is a non-central element of order $p$, and the subgroup it generates is not normal (since it is order $p$ and not central by assumption).
Suppose $p=2$. Then there are two very explicit cases, $D_8$ which doesn't work, and $Q_8$ which does.
Groups like this, in which every element of order $p$ are central, have been studied by JG Thompson and others. Maps like $\phi$ always exist, and serve to build the upper exponent-$p$ series of the group. In particular, if $Z(G)$ is cyclic, $p$ is odd, and every element of order $p$ is central, then $G$ itself is cyclic. If $Z(G)$ has rank 2, then the “socle series” of $G$ has factors of rank at most 2.
Best Answer
The answer to your first question is "no", even if you assume $G$, $\bar{G}$, and $K$ are all isomorphic! Take for example $\bar{G} = K = \mathbb{Z}$, $G \subset \bar{G}$ to be the subgroup generated by $\{2\}$, and let $\phi$ map $2 \in \bar{G}$ to $1 \in K$.
If you're allowed to extend $K$, then you can always find $\bar{\phi}$ by the following construction: Let $A$ be a generating set of $G$, and let $\bar{A}$ be such that the set $A \cup \bar{A}$ generates $\bar{G}$. Now take an explicit presentation of $\bar{G}$ with this generating set, and call the set of relations $R$.
Next, let $B \subset K$ be such that the set $B \cup \phi(A)$ generates $K$, and take an explicit presentation of $K$ using this generating set. Call the set of relations $R'$.
To construct $\bar{K}$, we'll form a new presentation. The generating set will be (symbolically) $A \cup \bar{A} \cup B$, and the relations will be everything in $R'$ (with the symbol $\phi(a)$ replaced by the symbol $a$), together with everything in $R$. Then $\bar{K}$ clearly contains $K$ as a subgroup (it's the subgroup generated by $A \cup B$).
Let $\bar{\phi}: \bar{G} \rightarrow \bar{K}$ then be the homomorphism defined to take generators in $\bar{G}$ to their counterparts in $\bar{K}$. This is indeed a homomorphism since relations in $\bar{G}$ are satisfied by their images, and it agrees with $\phi$ on $G$.