Very simple chi-square question I have a super simple  chi-square in R question, but I'm struggling to wrap my head around it. The question was to take a random 20 people from the dataset, count males and females and then use chi-square test to accept/reject the null hypothesis that half of the population in the entire large dataset is men.
So this is my data table:

How can I run chisq.test on just 2 numbers? Or should there be an 'expected' column with values of 10 for each row and then run the function? I haven't been able to find a similar chi-square problem on the internet.

As with any table, the chi-squared statistic is the sum of $(O-E)^2/E$ where $O$ is the observed count in each cell and $E$ is the expected count.
In your case, there are two cells with observations $12$ and $8.$  The null hypothesis asserts that the expected counts are each $1/2$ times the sample size, $E = 1/2\times 20 = 10.$  Thus
$$\chi^2 = \frac{(12 - 10)^2}{10} + \frac{(8 - 10)^2}{10} = \frac{8}{10}.$$
The p-value (for the two-sided alternative to the null; namely, that the population proportion of males differs from $1/2$) is approximated by the right tail area of a chi-squared distribution.  The one to use has $2-1 = 1$ degrees of freedom, because (a) you have two cells and (b) the null hypothesis specifies one parameter, leaving one left over. The p-value, computed with the R function pchisq(8/10, 1, lower.tail = FALSE), is 37%.

Some have contended this is the "wrong" test.  Far from it, this is an excellent test.  Part of the proof is to consider the distribution of the possible p-values under the null hypothesis.  (The other part is to examine its power, but that would take us far afield.)  Ideally, the p-values will be uniformly distributed between $0$ and $1.$ Because there are only $11$ distinct outcomes ($0$ and $20$ lead to the same decision, $1$ and $19$ to the same, and so on) the ideal is impossible to attain for any (non-randomized) decision procedure whatsoever.  But how close can we come?  Look at the actual distribution function:

The reference uniform distribution appears as the dashed red line.  The plot at left shows that the null distribution of p-values comes as close as reasonably possible to the uniform reference distribution, at least insofar as we can see.  (In the very rare cases where one of the cells is zero, I have set the p-value to zero.)
The plot at the right is the same, shown on log-log axes to reveal details for small p-values.  From left to right are the outcomes $0,20; 1,19; 2,18;$ and so on.  Except at the extreme left, where one of the cell counts is only $0$ or $1,$ the p-values are approximately uniformly distributed.  Moreover, this failure at the left is minor: in almost any case you would correctly reject the null even though the p-value is a little larger than it ought to be.
A standard rule of thumb, by the way, is that you can trust the chi-squared test when all expected counts are $5$ or larger.  In this case, both expected counts are $10:$ the rule gives good advice.
