Determine if subset of $C[a,b]$ is Compact Let $X = C[a,b] $ with the standard uniform metric. Let $g \in C[a,b]$
Prove that $F = \{f \in C[a,b] : |f(x)| \leq |g(x)| \; \; \forall x \in [a,b] \}$ is a compact subset $\iff g = 0$
$\impliedby$ is clear.
I've got a potential solution for the other direction and need someone to let me know if it's ok.
Suppose $g \neq 0$ . WLOG assume $\exists \; s$ s.t $g(s) > 0 $
By Continuity of $g \; \exists \; \delta >0$ s.t  $ \; \forall y \in (s- \delta, s + \delta) \subset [a,b] \implies \frac{g(s)}{2} < g(y) < \frac{3g(s)}{2}$
Now pick an Interval $[ \alpha, \beta]\subset g^{-1}\big(\frac{g(s)}{2},\infty\big) \subset [a,b] $
Let $$f_n(z) = \frac{z^2}{z^2 +(1-nz)^2} \; \; \forall z \in [0,1]$$
Then $f_n$ converges pointwise to $0$ but not uniformly since $f_n(\frac 1n) = 1$ 
Let $\phi = \frac{(t-\alpha)}{\beta - \alpha}$ be a homeomorphism from $[\alpha, \beta]$ to $ [ 0,1] $
Let $$h_n = \begin{cases}  \frac{g(s)}{2} \circ f_n \circ  \phi & x \in[\alpha,\beta] \\ 0 & x\in [a,b] \setminus [\alpha,\beta] \end{cases}$$ 
Then $h_n$ is a continuous function on $[a,b]$ and since $ |h_n(x)| \leq |g(x)|$
Then $h_n \in F \; \forall \; n \; \;$  but $h_n\big(\frac{\beta - \alpha}{n} + \alpha\big) = \frac{g(s)}{2} > 0 \; \forall \; n$ and so $h_n$ cannot converge uniformly either, nor can any subsequence. Thus $F$ is not Compact
Am I missing something, or is this ok?
 A: Unfortunately, there's a problem: $f_n(1) = \frac 1{n^2 - 2n +2}$, so $h_n$ isn't continuous. Regardless, your idea is all right: take a sequence without uniformly convergent subsequence and scale it to fit under $g$.
Your example can be easily fixed: eg. extend $f_n$ with some piece of linear function so that $f_n$ ends with $0$. However, we can just define $f_n$ to be suitable piecewise linear, or even simpler.
Here's some example:
$$
k_n(x) = 
\begin{cases}
\frac 12 g(s)\cdot \sin \Big(\frac{x-\alpha}{\beta-\alpha}\cdot \pi n\Big),
 & \text{for } x\in \Big[\alpha, \alpha + \frac 1n (\beta-\alpha)\Big],\\
0,& \text{otherwise.}
\end{cases}
$$
Check the values for $x-\alpha = 0,\ \frac 1{2n} (\beta-\alpha),\ \frac 1n (\beta-\alpha)$.
What I did was to take $\sin \pi x$ on $[0,1]$ (and $0$ outside), scale it to $[0, \frac 1 n]$, so I got an appropriate sequence on $[0,1]$, and then scale it (by your $\phi$, actually) inside $[\alpha,\beta]$ and under $g$.
Remarks:


*

*Of course many examples can be constructed in the same way. My first idea (now and several years ago, when given similar problem) was a piecewise linear function with a peak around $\frac 1n$ and up to $1$ (and $0$ around, and rescaled). Another was $nx(2-nx)$ ($= 1- (nx-1)^2$), but I settled with sine, because it seemed shorter and more elegant.

*The formulas can be made even briefer: if we define $M= \frac 1{\beta-\alpha}$, or if we denote the interval where $g$ is "large" by $[\alpha, \alpha + \frac 1M]$ to begin with, we get:
$$
k_n(x) = 
\begin{cases}
\frac 12 g(s)\cdot \sin \big(\pi Mn(x-\alpha) \big),
 & \text{for } x\in \big[\alpha, \alpha + \frac 1{Mn}\big],\\
0,& \text{otherwise.}
\end{cases}
$$

