Dirichlet problem on a disk with polynomial boundary values 
Suppose that  $\phi$ is a real valued harmonic function on the unit disc that is continuous up to the boundary such that $\phi$ agree with a real valued polynomial on the unit circle. Then $\phi$ must be a harmonic real valued polynomial.

I know that this question associated to the Dirichlet problem. But I did not get how to do it.
After carefully recheck the notes, I think I somehow get it.
$\phi$ is a polynomial on unit circle. So let $(x,y)\in S^1$. Then $\phi(x,y)=\sum a_{mn}x^my^n$. From here we want to deduct he whole $\phi$. Substitute $x=\frac{z+\bar{z}}{2}$ and $y=\frac{z-\bar{z}}{2}$. We get $\phi(z,\bar{z})=\sum c_{mn}z^m\bar{z}^n$.
Note that: $z=\frac{1}{\bar{z}}$. When $m>n$,  we have $z^m\bar{z}^n=z^{m-n}$
When $m<n$, we have $z^m\bar{z}^n=\bar{z}^{m-n}$. So $\phi(z,\bar{z})=P(z)+Q(\bar{z})$ is a real valued polynomial. (e.g. $\phi(a)=P(a)+Q(a)$) harmonic.
How do you guys think? Is this correct?
 A: Your idea is basically correct, but the presentation could be better: e.g., it is important to say that the sum $\sum a_{mn}x^my^n$ is finite. Also, a crucial part is missing: the uniqueness of a harmonic function with given boundary values (aka uniqueness for the Dirichlet problem). This fact is a consequence of the maximum principle. 
This is what I would say. The goal is to show that for every polynomial $p(x,y)=\sum_{m,n\le N}a_{mn}x^my^n$ there is a harmonic polynomial $q$ such that $p=q$ on the unit circle. From this the conclusion follows, because both $\phi$ and $q$ are harmonic and agree on the boundary. 
Now the computation goes as in your post: using $x=\frac12(z+\bar z)$ and $y=\frac1{2i}(z-\bar z)$, we rewrite  $p$ as a polynomial in terms of $z$ and $\bar z$. Then  use the identity, valid for $|z|=1$, 
$$z^m \bar z^n = \begin{cases}z^{m-n}(z\bar z)^{n} ,\quad m\ge n \\ \bar z^{n-m}(z\bar z)^{m} ,\quad m\le n \end{cases}
=\begin{cases}z^{m-n}  ,\quad m\ge n \\ \bar z^{n-m}  ,\quad m\le n \end{cases}
 $$
to replace every monomial in $p$ with a harmonic monomial that matches it on the unit circle. The resulting polynomial is $q$, and the claim follows.
The fact that $q$ is real valued follows from the fact that its imaginary part is a harmonic function that vanishes on the unit circle.
