The following cannot be considered a satisfactory answer since it does not provide a construction of the sought for harmonic function $u$: however, it provides a possible path for its construction. In my comments above I was perhaps fooled by the fact that I usually deal with boundary value problems, so I tried to see if the problem posed was reducible to a Cauchy problem. However, having thought a bit of it, it seems to me that the best approach to this specific case is by using approximation theory, precisely the following theorem, which is a particular case of a result proved by Stephen Gardiner (see [1], §1.10, pp. 23-24):
Theorem. Let $\Omega\subseteq\mathbf{R}^n$ an open set and $M$ be a compact subset of $\Omega$ whose interior is empty. The following statement are equivalent
- for each $f\in C(M)$ and each positive number $\epsilon$, there exists a function $u$ harmonic in $\Omega$ such that $|u-f|<\epsilon$ on $M$;
- $\Omega\setminus \hat{M}$ is a thin set (in the sense of potential theory, see for example [1], §0.2, p. 2) in the same points of $M$, where $\hat{M}$ is the union of all $\Omega$-bounded components of $\Omega\setminus M$ (see [1], §1.7, p. 18 for the precise definitions)
Notes
- The above theorem is less general than the one proved by Gardiner since I have assumed that $M$ has an empty interior, due to the hypothesis of low dimensionality: the result is true even if it is not so. In that case we have $u\in C(M)\cap\mathscr{H}(\overset{\circ}{M})$ and we need also $\Omega\setminus\overset{\circ}{M}$ to be thin in the same point as $M$: here $\overset{\circ}{M}$ is the interior of $M$ while $\mathscr{H}({A})$ is the set of all harmonic functions on the domain $A$.
- As said above this answer cannot be considered complete since I've not provided an explicit way to construct the sought for harmonic function $u$, possibly as a limit of an appropriate sequences of (likewise) harmonic functions when $f$ is real analytic on $M$. However, I'll try to see how this can be done.
References
[1] Stephen J. Gardiner, Harmonic approximation (English),
London Mathematical Society Lecture Note Series, 221, Cambridge: Cambridge University Press, pp. xiii+132 (1995), ISBN: 0-521-49799-X, MR1342298 Zbl 0826.31002.
[2] Peter Henrici, Applied and computational complex analysis. Volume I: Power series- integration-conformal mapping-location of zeros, reprint of the original, published in 1974 by John Wiley & Sons Ltd., Paperback ed. (English) Wiley Classics Library. New York etc.: John Wiley & Sons Ltd. xv, 682 p. $ 25.95 (1988), ISBN: 0-471-60841-6, MR1008928, Zbl 0635.30001