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.

Your problem can be seen as having an iid sample $X_1,\ldots,X_n$ with $X_i\sim \text{Bernoulli}(\theta)$, with say $X_i=1$ if the sample is female and $X_i=0$ otherwise. In this notation, $\theta$ is the probability of observing a female.
The aim is to test $H_0:\theta=1/2$ vs $H_1:\theta\neq 1$.
There are many ways to test $H_0$, e.g. through a hypothesis testing procedure or a confidence interval. Both can be obtained by noting that if $\hat\theta = \bar X$ is the sample proportion of females, then, under $H_0$
$$
n\bar X \sim \text{Bin}(n,\theta_0),
$$
which can be used to perform a test statistic or it may be inverted to obtain a confidence interval. There are many ways to perform such inversion and an exact R implementation is
> x <- 8
> n <- 20
> binom.test(x, n, p=0.50)

    Exact binomial test

data:  x and n
number of successes = 8, number of trials = 20, p-value = 0.5034
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.1911901 0.6394574
sample estimates:
probability of success 
                   0.4 

You might want to have a look also at the exactci package for other related approaches.
Another path may be to invoke the Central Limit Theorem, i.e.
$$
T_n = \frac{\sqrt{n}(\bar X - \theta)}{\sqrt{\theta(1-\theta)}}\overset{d}{\to} N(0,1).\quad\quad(*)
$$
Under $H_0$, $(*)$ is a pivotal quantity and can be used to build the approximate $\alpha$-level test statistic:

Reject $H_0$ if the observed value of $T_n$ is in absolute value
greater than $z_{1-\alpha/2}$.

Now for large $n$, $T_n^2$ will be approximately $\chi_1^2$, thus another equivalent $\alpha$-level test statistics would be

Reject $H_0$ if the observed value of $T_n^2$ is
greater than $\chi_{1-\alpha}^2$.

In R this can be performed (using a continuity correction for better accuracy) by
> x <- 8
> n <- 20
> prop.test(x, n, p=0.5)

    1-sample proportions test with continuity correction

data:  x out of n, null probability 0.5
X-squared = 0.45, df = 1, p-value = 0.5023
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
 0.1997709 0.6358833
sample estimates:
  p 
0.4 

