In the Poisson equation $$-\Delta u=f$$ $$u=g \in \partial \Omega$$ we usually see in textbooks the requirement $g \in H^{\frac{1}{2}}(\partial \Omega)$ and $u \in H^1(\Omega)$. In my case, $\Omega = [0,1]^2$
In an application, I am dealing with a portion $\Gamma \subset \partial \Omega$ ($\Gamma$ is the union of the lower and left edge) and I have that my data $g$ is \begin{cases} 1 \quad x \in \Gamma \\0 \quad x \in \partial\Omega \setminus\Gamma\end{cases}
Is $g \in H^{\frac{1}{2}}(\partial \Omega)$ ?
I should check that $\frac{|g(x)-g(y)|}{|x-y|^{3/2}} \in L^2(\partial \Omega \times \partial \Omega)$. But the term $g(x)-g(y)=0$ always, so I'd say that indeed $g$ is in $H^\frac{1}{2}(\partial \Omega)$
Is that correct?
No I don't think it is. The space $H^\frac12 (\partial \Omega)$ consists of all measurable function $u : \partial \Omega \to \mathbb R$ such that $$\int_{\partial \Omega} u^2 d \mathcal H^{n-1} + \iint_{\partial \Omega \times \partial \Omega} \frac{\vert u(x)-u(y) \vert^2}{\vert x -y \vert^n} d \mathcal H^{n-1}_xd \mathcal H^{n-1}_y $$ is finite. (Recall $d \mathcal H^{n-1} $ is the $(n-1)$-dimensional Hausdorff measure). Since in your case $n=2$, the above integrals are simply line integrals. For simplicity, I will just write $ds$ instead of $d\mathcal H^{n-1}$ from now on.
Let \begin{align*} S_1 &= [0,1] \times \{0\}, \quad S_2 = \{1\}\times[0,1], \quad S_3 = [0,1] \times \{1\}, \quad S_4 = \{0\} \times [0,1] \end{align*} and $\partial \Omega = S_1 \cup S_2 \cup S_3 \cup S_4$ be positively orientated.
Firstly, we have $$\int_{\partial \Omega} u^2 d s= 2\int_{S_1} d s= 2. $$
Now lets evaluate $$\iint_{\partial \Omega \times \partial \Omega} \frac{\vert u(x)-u(y) \vert^2}{\vert x -y \vert^n} d s_xd s_y. $$ Since $$\vert u(x)-u(y) \vert = \begin{cases} 1, &\text{if }(x,y) \in (\Gamma \times \Gamma^c) \cup (\Gamma^c \times \Gamma) \\ 0, & \text{else}. \end{cases}$$ it follows \begin{align*} \iint_{\partial \Omega \times \partial \Omega} \frac1{\vert x -y \vert^2} d s_xd s_y &= 2 \iint_{\Gamma \times \Gamma^c} \frac1{\vert x -y \vert^2} d s_xd s_y \\ &=8 \iint_{S_2\times S_1} \frac1{\vert x -y \vert^2} d s_xd s_y. \end{align*} Fix $y =(1,y_2) \in S_2$ and parametrise $x$ as $x(t)=(t,0)$. Then \begin{align*} \int_{S_1 } \frac1{\vert x -y \vert^2} d s_x &= \int_0^1 \frac1{(t-1)^2+y_2^2}dt= \frac1{y_2}\arctan \bigg ( \frac1{y_2} \bigg ). \end{align*} Thus, $$\iint_{S_2\times S_1} \frac1{\vert x -y \vert^2} d s_xd s_y = \int_{S_2} \frac1{y_2}\arctan \bigg ( \frac1{y_2} \bigg ) ds_y $$ which doesn't converge.