Imply means "to state indirectly."
Infer means "to draw a conclusion."
You may infer something from an implication, but you would not imply something from an inference.
Incorrect: She implied that he was from Canada by his accent.
Correct: She inferred that he was from Canada by his accent.
Incorrect: The poem inferred that the lover was unfaithful.
Correct: The poem implied that the lover was unfaithful.
Correct: He inferred from the poem that the lover was unfaithful.