Identifying null and alternative hypothesis I need help with an exercise. It says:
The president of a university claims that the mean time spent partying by all students at this university is not more than 7 hours per week. A random sample of 40 students taken from this university showed that they spent an average of 9.50 hours partying the previous week with a standard deviation of 2.3 hours. Test at the 2.5% significance level whether the president’s claim is true.
I understand that the null hypothesis is basically what the researcher is claiming.
So here I'm stating the null and the alternative hypothesis as:
$H_0: \mu=7$
$H_1:\mu\leq7$
I checked the solution for this exercise online and I'm getting:

I have a Statistics book that always states the null hypothesis as $\mu$ equals a value and the alternative hypothesis, depending on the claim, as $\mu$ less, greater or different that value. So I'm now confused because in the solution I found they put the in the null hypothesis the claim rather than in the alternative and then in the alternative that $\mu>7$ when that's is not the claim. I know what I have to do after that, but I'm stuck with that because if it is a lower tail then I do not reject the null hypothesis but if it is a right tail I do reject the null hypothesis, so the conclusion would be different.
 A: Wow.  Just...wow.
The answer is completely wrong and the question itself is trivial and ill-posed.
The claim that requires the support of evidence is the one made by the president, i.e., the mean time that students spend partying is not more than $7$ hours per week.  In order to test this claim in any statistically meaningful way, the hypothesis must be structured as you have stated (with a minor change):
$$H_0 : \mu > 7 \quad \text{vs.} \quad H_1 : \mu \le 7.$$
After all, it is the president's claim that is what needs to be substantiated, not the other way around.  And when framed this way, the observed data immediately invalidates the need for performing any calculation, since an observed mean of $9.5$ hours is on the wrong side of the evidence.  The resulting $p$-value of the test is $1.0$ without needing any calculation.
Moreover, note that the last part of the question asks "Test...whether the president's claim is true."  To do this in any meaningful way, one must be able to use the data to support the claim.  If we structured the test as
$$H_0 : \mu \le 7 \quad \text{vs.} \quad H_1 : \mu > 7,$$
that is to say, the null assumes that the president's claim is true, then there is no way to use the data to confirm that claim.  It can only be conditionally falsified under the assumption that the claim is true.
That said, if the question had been written in the following way:

The president of a university claims that the mean time spent partying by all students at this university is not more than 7 hours per week. However, the students' parents have reason to suspect otherwise, and find the president's claim implausible.  To show this, a random sample of 40 students taken from this university showed that they spent an average of 9.50 hours partying the previous week with a standard deviation of 2.3 hours. Test at the 2.5% significance level whether the president’s claim is false.

Note that the way this is phrased now makes it clearer that the research hypothesis is what the parents believe to be true, the claim $\mu > 7$ and their kids are spending too much time partying instead of studying.  Under this interpretation, the conclusion of such a test can either be:

*

*(Reject $H_0$):  The test shows with a high degree of statistical significance that students are spending on average more than $7$ hours a week partying.

*(Fail to reject $H_0$):  The test is inconclusive and there is not enough evidence to support the parents' belief that students are partying too much.

Note here that the second possibility--i.e., failure to reject $H_0$--does not mean the president's claim is true and that students aren't partying too much, but rather, only that the sample collected does not support the parents' suspicions.
In summary, I find this question to be flawed and not clearly teaching the correct way to construct, perform, and interpret a hypothesis test.
