Examples of classification problems:
Just as in the regression setting, in the classification setting we have a set of training observations $(x_1, y_1), ... , (x_n, y_n)$ that we can use to build a classifier. We want our classifier to perform well not only on the training data, but also on test observations that were not used to train the classifier.
There are at least two reasons not to perform classification using a regression method:
Thus, it is preferable to use a classification method that is truly suited for qualitative response values. Logistic regression is one example of the well-suited method for the case of a binary qualitative response.
In logistic regression, we use the logistic function:
$$ p(X)=\frac{e^{\beta_0+\beta_1X}}{1+e^{\beta_0 + \beta_1X}} $$
to avoid the situations where we might predict $p(X) < 0$ for some values of $X$ and $p(X) > 1$ for others. This function gives outputs between 0 and 1 for all values of $X$.