Let $I=[0, L]$ be an interval and let the $n+1$ node points $\left\{x_{i}\right\}_{i=0}^{n}$ define a partition $$ I: 0=x_{0}<x_{1}<x_{2}<\ldots<x_{n-1}<x_{n}=L $$
of $I$ into $n$ subintervals $I_{i}=\left[x_{i-1}, x_{i}\right], i=1,2 \ldots, n,$ of length $h_{i}=x_{i}-x_{i-1}$
We define the following space$$ \begin{array}{l} \\ \qquad V_{h}=\left\{v: v \in C^{0}(I),\left.v\right|_{I_{i}} \in P_{1}\left(I_{i}\right)\right\} \end{array} $$ where $C^{0}$ (I) denotes the space of continuous functions on $I,$ and $P_{1}\left(I_{i}\right)$ denotes the space of linear functions on $I_{i} .$ i.e $P_{1}(I)=\left\{v: v(x)=c_{0}+c_{1} x, x \in I, c_{0}, c_{1} \in \mathbb{R}\right\}$
It should be obvious according to my notes that $\left\{\varphi_{j}\right\}_{j=0}^{n}$ such as:
$\varphi_{j}\left(x_{i}\right)=\left\{\begin{array}{ll}1, & \text { if } i=j \\ 0, & \text { if } i \neq j\end{array}, \quad i, j=0,1, \ldots, n\right.$
is a basis for $V_{h}$ but unfortunately I can't make an argument why this should be true ...
Another point that may seems a trivial one but its a troublemaker for me is how they construct this function from the previous one:
$\varphi_{i}=\left\{\begin{array}{ll}\left(x-x_{i-1}\right) / h_{i}, & \text { if } x \in I_{i} \\ \left(x_{i+1}-x\right) / h_{i+1}, & \text { if } x \in I_{i+1} \\ 0, & \text { otherwise }\end{array}\right.$
Thanks a lot
I had a complete answer previously, but this could be a homework problem, so I'll just offer hints...
The $\phi_i$ can be visualized by imagining a function given by forming a triangle with a peak at the point $x_i$ and a base extending from $x_{i-1}$ to $x_{i+1}$, being $0$ everywhere else. This seems like a good choice of basis to work with as it allows you to think locally about each $x_i$ at a time.
Hint for showing the $\phi_i$ span: Let $f \in V$. Any line is determined by two points, so any $f \in V$ is uniquely determined by its values on $x_0, \ldots, x_n$, so we just need to construct a linear combination of the $\phi_i$ that matches $f$ on those points. Since $\phi_i$ vanishes everywhere except $x_i$ it's not hard to find the right choice of coefficient.
For linear independence, suppose there are $\alpha_i$ with $\sum_{i=0}^n \alpha_i \phi_i = 0$; that is, $\sum_{i=0}^n \alpha_i \phi_i(x) = 0$ for any choice of $x$. So we just choose the $x$ most convenient for us to show $\alpha_j = 0$.