Let $\|\cdot\|$ be $\ell_2$-norm in $\mathcal{R}^n$, and $\psi(x)=\frac{1}{2}\|x\|^2$ for $x \in X$ and $+\infty$ for $x \notin X$. Show that conjugate of $\psi(x)$ is given by $\psi^*:\mathcal{R}^n \rightarrow \mathcal{R}$ $$ \psi^*(z)=\frac{1}{2}(\|z\|^2 -\|z -\pi_X(z)\|^2) $$
where $\pi_X(x)=\arg \min \{\|x-y\|\mid y \in X\}$ is Euclidean projection onto $X$.
By definition, \begin{align} \Psi^*(z) &= \sup_x \, \langle z, x \rangle - \Psi(x) \\ &= \sup_{x \in X} \, \langle z, x \rangle - \frac12 \| x \|_2^2. \end{align} Now complete the square: $$ \langle z, x \rangle - \frac12 \| x \|_2^2 = -\frac12 \left( \|x - z \|_2^2 - \|z\|_2^2\right) = \frac12 \|z\|_2^2 - \frac12 \|x - z \|_2^2. $$ It follows that \begin{align} \Psi^*(z) &= \sup_{x \in X} \,\frac12 \|z\|_2^2 - \frac12 \|x - z \|_2^2 \\ &= \frac12 \|z\|_2^2 - \frac12 \|z - \Pi_X(z) \|_2^2. \end{align}