I think you can do it in a homework exercise, but only as a bonus question that is not part of the ordinarily graded questions. Adding it to an exam is not fair, for reasons mentioned in other answers. But rather than using it to find a breakthrough in your own research, use it to find hidden geniuses among the students. Make it very clear that those questions are completely optional and harder than the main homework questions; you may or may not state that they are actually open problems.
There are historical examples of students who solved open problems in homework exercises. For example, George Dantzig:
An event in Dantzig's life became the origin of a famous story in 1939 while he was a graduate student at UC Berkeley. Near the beginning of a class for which Dantzig was late, professor Jerzy Neyman wrote two examples of famously unsolved statistics problems on the blackboard. When Dantzig arrived, he assumed that the two problems were a homework assignment and wrote them down. According to Dantzig, the problems "seemed to be a little harder than usual", but a few days later he handed in completed solutions for the two problems, still believing that they were an assignment that was overdue.
Six weeks later, Dantzig received a visit from an excited professor Neyman, who was eager to tell him that the homework problems he had solved were two of the most famous unsolved problems in statistics.
Of course, when you do against all odds find a hidden genius this way, you can offer to supervise him or her in writing a publication, which should land you co-authorship on the paper.