I suppose you know how to show that the minimal polynomial of the restriction $\mu'$ of $A$ to an $A$-invariant subspace divides the (global) minimal polynomial $\mu$ of $A$ (if not, the hint is to show that it divides any polynomial $P$ for which $P[A]$ vanishes on the subspace). But I cannot really see how this fits into a proof of the mentioned statement, which does not even become significantly simpler if we assume that $\mu'$ and $\mu$ are equal (in the general case of the question, the kernel of $(\mu/\mu')[A]$ is $A$-invariant and intersects $W$ only in $\{0\}$, but this is just the easy part of a complementary subspace$~U$ to be found, and when $\mu'=\mu$ we have actually gained nothing).
Here is a proof I can come up with; I'm not sure this was the intended one. Since $\mu$ is square-free, it is a product of distinct irreducible factors, and by the kernel decomposition theorem, the whole space decomposes canonically as a direct sum of kernels $V_P=\ker(P[A])$ where $P$ runs over the irreducible divisors of$~\mu$. The $A$-stable subspace $W$ is a direct sum of its ($A$-stable) intersections with these subspaces $V_P$, and provided that in each $V_P$ we can find an $A$-stable complement to that intersection, we can form as our subspace $U$ the direct sum of those complements, easily shown to be an $A$-stable complement of $W$. Thus we have reduced the problem (by restricting to each $V_P$) to the case where the minimal polynomial is irreducible.
Since by definition $P[A]$ acts trivially on $V_P$, that subspace is a $K[X]/P$ module where the image of $X$ acts as $A$, and its $A$-invariant subspaces are precisely the $K[X]/P$ sub-modules. But $K[X]/P$ is a field$~F$, so we are looking to find a complementary $F$-subspace to a given $F$-subspace of $V_P$. But for finite dimensional vector spaces it is well known that all subspaces admit a complementary subspace, and this finishes the proof. This last part was in fact the subject of another question on this site.