Is every function eligible as a boundary condition? Consider the Laplace equation on unit square domain:
$$
u_{xx} + u_{yy} = 0, 0 < x < 1, 0 < y < 1
$$
I wondered whether there is any boundary condition that wouldn't let this equation have a solution. Suppose the boundary condition is $u(t,0) = u(t,1) = u(0,t) = u(1,t) = f(t)$ for some real-valued function $f$.
I thought $f$ would need to be "pathological". The candidates I came up in mind were:

*

*Dirichlet's function: Though this candidate might let the equation seem unsolvable at first glance, my intuition tells that the solution would be $u = 0$ anyway, for Dirichlet's function is zero almost everywhere.


*Thomae's function: This suffers from the same argument as above. Not to mention that Thomae's function is Riemann-integrable.


*Cantor's staircase: This really would make the equation seem weird, but still, my intuition tells that the usual methods of solving PDE, such as separation of variables, superposition principle, and Fourier transform, would go through well anyway.


*Minkowski's question-mark: Again, this suffers from the same argument as above.


*Weierstrass' function: Would being nowhere differentiable make it? Hell if I know.


*Indicator function on Vitali set: Now I'm talking about non-measurability. Dang.
Is there an example of such $f$? Or to loosen the requirements, is there any instance of Laplace equation whose boundary condition doesn't let a solution to be there?
 A: The query "dirichlet problem measurable" came up with this article, https://www.pmf.ni.ac.rs/filomat-content/2022/36-6/36-6-26-16698.pdf "Dirichlet Problem with Measurable Data in Rectifiable Domains"
Vladimir Ryazanov, which sounds a lot like what you are looking for. In the introduction, Ryazanov tells us that Luzin proved (seemingly as early as 1915)

*

*Theorem B: Let $\varphi: \mathbb R \to \mathbb R$ be a $2\pi$−periodic measurable function (which of course can be thought of as a function on the circle $\partial \mathbb D$). Then there is a harmonic function $u$ in $\mathbb D$
such that $u(z) \to \varphi(\theta)$ for a.e. $\theta \in \mathbb R$ as $z \to e^{i\theta}$ along any nontangential path.

Ryazanov says that Luzin proved this "just on the basis of Theorem A" which Luzin proved as early as 1912, where

*

*Theorem A: For any measurable function $\varphi : [0, 2\pi] \to \mathbb R$, there is a continuous function $\Phi : [0, 2\pi] \to \mathbb R$
such that $\Phi' = \varphi$ a.e. on $[0, 2\pi]$
This Theorem A is surprisingly not well-known at all (I asked some analysts at my university and they didn't know of it). It is a stronger version of part of the much more well-known

*

*Lebesgue $\int \circ \frac{d}{dx}$-FTC , which says in part that if $\varphi$ is Lebesgue integrable on $[a,b]$, then the integral $F(x):=\int_a^x \varphi(t) dt$ is an absolutely continuous hence a.e. differentiable function whose derivative equals $\varphi$ a.e., i.e. the set of $x\in (a,b)$ for which $F$ is differentiable at $x$ and has $F'(x)=\varphi(x)$ has measure $=|[a,b]|=b-a$ (see also the Lebesgue $\frac{d}{dx} \circ \int$-FTC).

Anyways, once I knew that the Dirichlet problem is solved on the disk $\mathbb D$, my intuition said that because the Riemann mapping theorem (RMT) tells us there is a biholomorphic map between $\mathbb D$ and any simply-connected proper open subset of $\mathbb C$, and because holomorphic functions are closely related to harmonic functions (taking real/imaginary parts to go $\leadsto$, and harmonic conjugates to go backward), this should mean that the Dirichlet problem with measurable data should also be solved on e.g. the square. Indeed, searching "dirichlet problem disk riemann mapping" brings us to Easy application of the Riemann Mapping Theorem, tells us that:

If we have a

*

*closed simple Jordan curve $\gamma:[0,1] \to \mathbb C$, where we denote (simply-connected, bounded, open) the interior as $\Omega$ (one needs the Jordan curve theorem to define this interior) and observe that $\partial \Omega = \gamma([0,1])$,

*and a measurable function $f:[0,1] \to \mathbb R$ (which can be thought of as the measurable initial boundary data $\tilde f: \partial\Omega \to \mathbb R$ defined by $\tilde f(\gamma(t)) := f(t)$);

then Caratheodory's boundary extension version of the RMT tells us there is a biholomorphic/conformal mapping $\Phi: \Omega \to \mathbb D$ that extends continuously to a homeomorphism $\hat \Phi : \overline{\Omega} \to \overline{\mathbb D}$, where $\tilde \varphi:= \tilde f \circ (\hat\Phi)^{-1}$ mapping $\partial \mathbb D \to \partial \Omega \to \mathbb R$ is now measurable initial data on $\partial \mathbb D$.
Then Luzin's solution to the Dirichlet problem on the disk with measurable initial data produces a harmonic function $v: \mathbb D \to \mathbb R$ such that $u$ "extends continuously to the boundary", meaning $v(z) \to \tilde \varphi(z_0)$ as $z \to z_0 \in \partial \mathbb D$ as long as all $z\in \mathbb D$ (we are only allowed to approach $z_0$ from within the interior of the disk).
Finally, one can check that $u:= v \circ \Phi : \Omega \to \mathbb R$ is a harmonic function on $\Omega$ that "extends continuously to the boundary", with that extension to $\partial \Omega$ agreeing with the measurable initial data $\tilde f : \partial \Omega \to \mathbb R$.

Lastly, since the initial data $\tilde \varphi: \partial \mathbb D \to \mathbb R$ is the pointwise limit as $r \nearrow 1$ of the continuous functions formed by the harmonic function $v:\mathbb D \to \mathbb R$ restricted to circles $\partial B(0,r)$, it must necessarily be measurable. So we can rephrase the above big theorem as an "iff" statement:

Given a simple closed Jordan curve $\gamma:[0,1] \to \mathbb C$ with interior $\Omega$, and initial data $f:[0,1]\to \mathbb R$ and $\tilde f(\gamma(t)) := f(t)$, the Dirichlet problem on $\Omega$ with initial data $\tilde f$ on $\partial \Omega$ can be solved if and only if $\tilde \varphi:= \tilde f \circ (\hat\Phi)^{-1}$ mapping $\partial \mathbb D \to \partial \Omega \to \mathbb R$ is measurable initial data on $\mathbb D$, which happens if and only if $\tilde f = \tilde \varphi \circ \hat \Phi : \partial \Omega \to \partial \mathbb D \to \mathbb R$ is measurable itself, since $\hat\Phi:\partial \Omega \to \partial \mathbb D$ is a continuous bijection; which by definition means exactly that the original $f: [0,1] \to \mathbb R$ is a measurable function.

And to bring it back to your explicit example, of course $\gamma$ describing the path around the unit square is a simple closed Jordan curve, so the above theorem applies.
