confused about which approach to use when testing a hypothesis on a proportion I'm quite confused about how should I go at the moment of testing the hypothesis that a rate is or is not equal to a certain number. Suppose I suspected that a certain rate was equal to 0.05 and then ran an experiment with 1000 samples and found an observed rate of 0.04.
1) If I calculated what’s the probability of getting a sample like that given that the true rate is 0.05, then I would get a result of around 0.073397.
2) If I calculated what’s the probability that the true population rate could be 0.05 given than my sample rate was 0.04, then the probability would be 0.053292.
I’m pretty sure that 2) would be the “correct” or logical way to go around this question, but why would 1) be wrong? Which approach would you use?
 A: It's actually (1) that's the correct way, but your question raises some interesting aspects that are worthy of additional discussion.
With the usual kind of hypothesis test, you compute the distribution of the test statistic under that null hypothesis (that is, as if it  - and any additional assumptions you make - were true). [To simplify things, I've further assumed it's a simple null and of the form where you have a stated alternative. This is all consistent with your details.] 
You then compute the test statistic for your sample, and if it's in a small region of the null-distribution of the test statistic that's most consistent with the alternative, you'll reject the null.
So your null hypothesis has the population proportion $p=0.05$ and your alternative is that $p\neq 0.05$.
Your test statistic is the sample proportion (or some simple function of it). Proportions far above 0.05 or far below it lead you to reject (how far is far depends on sample size and your chosen significance level).
What you are talking about computing in your question sounds like a p-value, which is the probability of a result at least as far from the null value of 0.05 as the one you observed in your sample. In that case, you reject if that p-value is smaller than your chosen significance level.

Now you could also cast it as a confidence interval problem. In that case you do treat the sample proportion (since it's your best estimate of the population proportion) as the basis on which to compute the standard error, and you form an interval around your 0.04. If you do that, it is in fact possible that you could conclude that 0.05 was not in the confidence interval even though 0.04 wouldn't be rejected if you tested $H_0: p=0.05$ using a hypothesis test. Which is to say, this is one of the cases where hypothesis testing and consideration of whether the hypothesized value lays within the CI lead to different conclusions. 
