Using the definition of convexity in $\mathbb{R}$,
$$f \left( \lambda x + (1 − \lambda) y \right) \leq \lambda f(x) + (1 − \lambda) f(y)$$
I am able to prove the convexity of function $f$. However, for a function in $\mathbb{R^2}$, I am not sure how this inequality changes. E.g., given the function $f(a, b) = a^2 + b^2$, how do I use this inequality?
\begin{align*} f(\lambda(a,b)+(1-\lambda)(c,d))&=f(\lambda a+(1-\lambda)c,\lambda b+(1-\lambda)d)\\ &=(\lambda a+(1-\lambda)c)^{2}+(\lambda b+(1-\lambda)d)^{2}\\ &\leq\lambda a^{2}+(1-\lambda)c^{2}+\lambda b^{2}+(1-\lambda) d^{2}\\ &=\lambda(a^{2}+b^{2})+(1-\lambda)(c^{2}+d^{2})\\ &=\lambda f(a,b)+(1-\lambda)f(c,d), \end{align*} where we have used the basic convexity of the function $(\cdot)^{2}$ of one variable.