I have a following problem: Let $B^2$ be an open unit ball in $\mathbb R^2$ and $$ S = \{(x, y, z) \in B^2 \times \mathbb R: \frac12(x^2 + y^2)z^3 + xyz^2 + z - 2 = 0\}$$
Show that $S$ is globally a graph of a $C^\infty(D)$ function $z = f(x, y)$.
I had no problem showing that it is true in a neighbourhood of every point using implicit function theorem, but how to show that this function is constructable globally? Does it require using something like the pasting lemma?
You have to show that for each $(x,y) \in B^2$ there exists a unique $z \in \mathbb R$ such that $$\phi(z) = \frac12(x^2 + y^2)z^3 + xyz^2 + z - 2 = 0 .\tag{1} $$ For $(x,y)= 0$ this is obvious. For $(x,y) \ne (0,0)$ write $(x,y) = r(\cos t, \sin t)$ with $0 < r < 1$. We get $$ \phi(z) = \frac12 r^2z^3 + \frac 12 \sin (2t)r^2z^2 + z - 2 \tag{2}.$$ Consider $$\phi(z) = \frac32 r^2z^2 + \sin (2t)r^2z + 1 . \tag{3}$$ We claim that $f'(z)$ does not have a zero. This implies that $\phi'(z) > 0$ for all $z$. Hence $\phi$ is strictly increasing and $\phi$ has a single (real) zero.
The disriminant of the quadratic polynomial in $(3)$ is $$\sin^2(2t)r^4 - 6r^2 \le r^4 - 6r^2 = r^2(r^2 - 6) < 1 \cdot (1-6) < 0$$ and this proves our claim.
As you mentioned in your question, the implicit function theorem allows to conclude that $f(x,y) =$ zero of $\phi$ is smooth.