Considering a function $f\in\mathscr({C}(K),\lvert\lvert \cdot\rvert\rvert_\infty)$, i.e.$$f:K\rightarrow\mathbb{C}$$ everywhere continuous where $K$ is a compact subset of $\mathbb{R}^n$, does $f$ lie in $L^p(K)$ for every $1\le p\le\infty$?
I would say yes. The $p=\infty$ case is true because the essential supremum is smaller or equal to the actual supremum everywhere, and for $p\not=\infty$$$\int_K\lvert f(x)\rvert^p \mathrm{d}x\le \sup_{x\in K}\lvert f(x)\rvert^p \mu(K)^p$$ where $f$ assumes its maximum because of continuity everywhere and $K$ being compact, and the Lebesgue-measure of a compact set is also finite as I understand it.
I'm not sure though, because in the solutions for an exercise I did they use $K=[0,1]^2$ and say that for $x\in K$ one has $\int_0^1\lvert f(x,y)\rvert^2\mathrm{d}y\lt\infty$ only almost everywhere, but shouldn't this hold everywhere?
I didn't write that $K$ lies in $\mathbb{R}^n$ in the title because I assume this applies for general compact measure spaces as well?
You are right. The inequality $$\int_K\lvert f(x)\rvert^p \mathrm{d}x\le \sup_{x\in K}\lvert f(x)\rvert^p \mu(K)^p$$ shows that $C(K)\subset L^p(K)$ for every compact topological space equipped with a finite Borel measure $\mu$.