My attempt:Let G be a graph were V(G)=n and $V_{max}(G)$ is the value we are looking for. We dont want G to contain any path with m edges, so if there is a path with m edges then there must be at least m edges in the graph. Therefore let G be a union of two disjunct components, A and B, such that $A \cup B=G$ and $A \cap B= \emptyset$. Let $E(A)=a=m-1<m.$ Then what value can E(B) have?
Construct the smallest trail in $A$, then $V(A)=a-1=m-2.$ Then $V(B)=n-(m-2)=n-m+2$ vertices. We now want to maximize $n.$ And now I don't know how to get further?