In class we encountered this function $$f_n(x)=\begin{cases} n^2x, & 0 \leq x \leq 1/n\\ 2n - n^2x, & 1/n \leq x \leq 2/n\\ 0, & 2/n \leq x \leq1 \end{cases}$$
The prof said that this function is not uniformly convergent because the integral of the limiting function $f(x) = 0$ is $0$, but the integral of the piecewise function is nonzero for all $n$ i.e. it is equal to the area of the triangle that it forms
However I don't feel like this explanation helps.
What is the method for proving the non-uniform convergence of this sequence rigorously?
If you have already on hand a theorem that uniform convergence implies convergence of the integral, like Baby Rudin 7.16, then the proof you've been given is perfectly rigorous. The triangle comment establishes that the value of the integral is independent of $n$. In more detail, the integral from $0$ to $1/n$ is ${1\over 2}(1/n)n={1\over 2}$ because $f_n(1/n)=n$, and the integral from $1/n$ to $2/n$ is also ${1\over 2}(1/n)n={1\over 2}$; the integral over the rest of the interval is $0$.
You can also note that uniform convergence means that given $ \epsilon>0$, we can find $N$ such that $|f_n(x)-f(x)|<\epsilon$ for $n\ge N$ and for all $x$ in the domain. We have $f(x)=0$ and yet $f_n(1/n)=n$, so we can't have $|f_n(1/n)-f(1/n)|<\epsilon$ no matter how big we make $n$.