How should I state the null and alternative hypotheses, when the alternative speaks in favour of the null one? The question is as follows:

More than 50% of all people usually drink coffee before breakfast. To
check this claim 100 people were chosen randomly and 60 of them
declared to have a coffee before breakfast.

Clearly the sample taken confirms that the null hypothesis is correct. Moreover, it is said alternative hypothesis never contains <=, >= or = operators, so even if I set H0: p > 0.5, I shouldn't do Ha: p <= 0.5, which would contradict the sample taken. How should I deal with this problem? Or could that be an error in the question?
 A: I don't think there's an error in the question, you could perform a one-tailed test.
This is how I would choose to define the null and alternate hypothesis
$$
H_0: p \leq 0.5\\
H_1: p > 0.5
$$
I'll explain why,

*

*The alternate hypothesis can be defined with $\leq$ or $\geq$  operators, I'm not sure where you read that you cannot use these operators in the alternate hypothesis, or maybe you were referring to traditional two-tailed tests.

When I was first learning hypothesis testing, I used this book - "Statistics" by Robert S. Witte and John S. Witte (commonly referred to as Witte and Witte). I strongly recommend it, it will provide you with strong basics, suitable for whatever your current comfort level is in regard to the topics.


*Rejecting the null hypothesis is a stronger decision than to accept it.

Assuming we plan to perform the $Z$ test, this is what the $Z$ distribution would look like

You are given a sample and you want to check to see if the sample arises from a particular distribution (or given the sample, you want to check if the mean of the population distribution is some $\mu_0$ i.e. your hypothesis is $H_0: \mu = \mu_0$) , so you compute the $z$ score of the sample and if the $z$ score lies within the range $[-1.96, 1.96]$ you supposedly "accept" the hypothesis with 95% probability of your decision being right. But if suppose the mean of the population distribution was slightly shifted to the right or left, it is highly likely that the sample could still arise from the new distribution when they overlap like so

In this image, the "acceptance regions" will also have a really large overlap, and hence it might also be the case that $\mu_0$ is not the right mean of the population.
Therefore, accepting the hypothesis is always a weak decision, but when you are faced with a scenario where you end up not rejecting the null hypothesis, it's better to state that you cannot reject the null hypothesis given the samples you were provided with instead of stating that you "accept" the hypothesis
Let us now look at the other possible decision, rejecting the null hypothesis. Explaining why this decision is a strong decision is easy,
At $\alpha = 0.5%$ what is the probability that we reject the null hypothesis given that it is actually true (or what is the probability with which we make a mistake when the decision we take with the samples we have is the rejection of the null hypothesis ?) = $\alpha$ (which is usually low)
Because of this reason, rejecting the null hypothesis is a strong decision.
When we're dealing with a hypothesis involving operators like $\geq$ and $\leq$, we usually perform one-tailed tests. In two-tailed tests, we would reject an equality claim if the sample leans away from the claim value (lower or higher), in one-tailed tests we're only concerned with one direction.

So in your question, if suppose all 100 people sampled have coffee before breakfast, this wouldn't cause you to reject the claim made but if none of the 100 have coffee before breakfast you have strong evidence to reject the claim (i.e. you only care about one direction)
Now, to solve your question, I'm going to assume $\alpha = 0.5$. When performing the $Z$ test, these will be the decision rules I would follow

*

*If $z >= 1.65$, I reject the null hypothesis (which states that the proportion $p$ is less than $0.5$) and thereby accept the claim with $95%$ confidence (you have a sample that has a significantly higher proportion than 0.5, a significant sample)


*If $z < 1.65$ I accept the null hypothesis and thereby do not accept the claim made (which is more than $50%$ of people have coffee before breakfast)
I would assume the data follows a binomial distribution and use its normal approximation to perform the test.
Most of the images I've used are from the book I mentioned. I apologise if I got something wrong, or failed to answer or understand your question.
A: I agree with you. To prove a null hypothesis the data MUST contraddict it. If the data spead in favour of the hypothesis to prove there is nothing to prove and $\mathcal{H}_0$ cannot be rejected.
