How to choose a kernel function and a feature mapping function?
To answer your questions:


Yes, $\phi((x_1,x_2))=(x_1,x_2,(x_1-2.5)^2)$ is a good choice. You can also remove the second dimension $x_2$, as it's zero for all of your training examples. By doing so, you will have a mapping function $\phi:\mathbb{R}^2 \to \mathbb{R}^2$ which is: $\phi((x_1,x_2))=(x_1,(x_1-2.5)^2)$. (Also note that mapping into higher dimension in not necessary; mapping to a space where data becomes linearly separable is sufficient.)
Kernel function $K$ calculates the dot product of points in the new space, so we have:


$$K(x,y)=\left\langle \phi(x),\phi(y)\right\rangle=\left\langle (x_1, (x_1-2.5)^2),(y_1,(y_1-2.5)^2)\right\rangle=x_1y_1+(x_1-2.5)^2(y_1-2.5)^2 \to K(x,y)=x_1y_1+((x_1-2.5)(y_1-2.5))^2$$