Squared error Cost function shape

I just wanted to know is the of squared error cost function always convex (shape of a bowl)
Or that applies only for linear regression?

  1. Yes, the squared-error cost function is always convex.
  2. We only use that cost function for linear regression.