Show that if $D$ does not contain a directed path of length $m$, then $\chi(D) \le m$ Given a digraph $D$, we define $\chi(D)$ as the chromatic number of the underlying undirected graph. Show that if $D$ does not contain a directed path of length $m$, then $\chi(D) \le m$.

I've tried doing this proof by contradiction.
Assume by contradiction that $\chi(D) > m$. Let $P$ where $|P| = m-1$ be the directed path with maximum length in $D$. Since $\Delta(D) + 1 \ge \chi(D) > m \Rightarrow \Delta(D) > m-1 \Rightarrow \Delta(D) > |P|$. (Show that $\Delta(D)$ can't be greater than the largest path? Or maybe that if $\Delta(D) > |P|$ we can extend $|P|$?)

This is as far as I've gotten, I'm not sure if this path I'm taking is a good one for approaching this proof.
 A: I'll show that if $k$ is the length of the longest directed path in $G=(V, E)$ (measured as the number of edges on that path), then $\chi(G) \leq k+1$, which is equivalent to the statement in question.
Let $k$ be the length of the longest directed path in $G$ and let $G' = (V, E' \subseteq E)$ be a maximal acyclic subgraph of $G$. Graph $G'$ contains all the vertices and a maximal set of edges such that there are no directed cycles in $G'$. That means that adding any edge $e \in (E \setminus E')$ to $G'$ generates a directed cycle.
Let us now colour each vertex $v$ of $G'$ with the length of the longest directed path ending in $v$. As the longest path in $G'$ has length at most $k$, we use at most $k+1$ colours (from $0$ to $k$). Notice that the edge is always oriented from the vertex coloured with a lower number to the vertex coloured with a higher number. Also, two vertices of the same colour cannot be adjacent, as one of them would be lying further down the longest path than the other. That means that $G'$ is properly coloured with at most $k+1$ colours.
Let us now consider the remaining edges of $G$. Let $e = (u, v) \in E \setminus E'$ be any such edge. As $G'$ was a maximal acyclic subgraph of $G$, adding $e$ to $G'$ generates a directed cycle. That means that that there exists a directed path from $v$ to $u$ in $G'$ and, therefore, $u$ and $v$ have different colours. That means that adding $e$ to $G'$ does not break the colouring and also that the colouring is valid for $G$. We have properly coloured $G$ with at most $k+1$ colours, which concludes the proof.
