Understanding p-value in terms of Density Function I was looking at my statistics lecture notes on Bayesian inference, and they talk about a p-value. Specifically, they say that a p-value is the probability that the observed effect is due to random/spurious effects. So, if p = 0.05, there is a 5% probability that the observed effect is due to random effects.
Given this, I am trying to understand this in terms of a probability density function, say $f(x)$. How would one use this density function to determine if some event is spurious?
 A: p-values are not commonly used in Bayesian inference, so this is a bit confusing. See for example What are Bayesian p-values? for some discussion of "Bayesian p-values". I'm going to assume you are talking about a frequentist p-value.  It's notoriously hard to get the definition right for what a p-value is. To correct your sentence, you have to add something about the assumption of the null-hypothesis. Also, it's the other way around, assuming the null hypothesis, there is a five percent chance that it would generate an event at least extreme as the event you witnessed. You cannot draw any conclusions about what happens if your model is wrong, so an unqualified "95% chance the null hypothesis is incorrect" is not a conclusion you can draw.
To answer your question more directly. If $f$ is the density function for the statistic you are testing under the null hypothesis, a p-value of 0.05 means that there is 5% probability mass, or an area of 0.05 under the curve of $f$ for an outcome more extreme than the one you witnessed. You would need to specify whether this is calculated based on a two-tailed or one-tailed hypothesis.
