For all the following integrals, the limits are from $-\infty$ to $\infty$.
Assume we are working in the position representation.
For $\hat{x}$ to be Hermitian we must show that:
$$\langle{\phi|\hat{x}\psi}\rangle=\langle{\psi|\hat{x}\phi}\rangle^*$$
LHS:
$$\langle{\phi|\hat{x}\psi}\rangle=\int{\phi^*(x\psi)dx}$$
RHS:
$$\langle{\psi|\hat{x}\phi}\rangle^*=\left(\int{\psi^*(x\phi)dx}\right)^*$$
Eigenvalues of $\hat{x}$ are real, $x=x^*$:
$$\langle{\psi|\hat{x}\phi}\rangle^*=\int{\psi(x\phi^*)dx}$$
$$=\int{\phi^*(x\psi)dx}$$
$$\therefore\langle{\phi|\hat{x}\psi}\rangle=\langle{\psi|\hat{x}\phi}\rangle^*$$
Thus, $\hat{x}$ is Hermitian.
For $\hat{p}$ to be hermitian we must show the following:
$$\langle{\phi|\hat{p}\psi}\rangle=\langle{\psi|\hat{p}\phi}\rangle^*$$
LHS:
$$\langle{\phi|\hat{p}\psi}\rangle=\int{\phi^*\left(-i\hbar \frac{\partial\psi}{\partial x}\right)dx}$$
RHS:
$$\langle{\psi|\hat{p}\phi}\rangle^*=\left(\int{\psi^*(-i\hbar \frac{\partial\phi}{\partial x})dx}\right)^*$$
$$=\int{\psi\left(i\hbar \frac{\partial\phi^*}{\partial x}\right)dx}$$
$$=i\hbar \int{\psi\left(\frac{\partial\phi^*}{\partial x}\right)dx}$$
Using integration by parts gives:
$$\langle{\psi|\hat{p}\phi}\rangle^*=[\phi^*\psi]_{-\infty}^{\infty}-i\hbar \int{\phi^*\left(\frac{\partial\psi}{\partial x}\right)dx}$$
Assume the wavefunctions go to zero at infinity then:
$$\langle{\psi|\hat{p}\phi}\rangle^*= -i\hbar \int{\phi^*\left(\frac{\partial\psi}{\partial x}\right)dx}$$
$$= \int{\phi^*\left(-i\hbar\frac{\partial\psi}{\partial x}\right)dx}$$
$$\therefore \langle{\phi|\hat{p}\psi}\rangle=\langle{\psi|\hat{p}\phi}\rangle^*$$
Thus $\hat{p}$ is Hermitian.