the following website states that linear regression assumes a linear relationship between dependent and independent variables: "First, linear regression needs the relationship between the independent and dependent variables to be linear. " from: https://www.statisticssolutions.com/assumptions-of-linear-regression/
However, I have read elsewhere that linear regression can be applied to non-linear relationships, such as fitting a curved line such as f(x) = x^2 to a set of data.
Which one is correct?
Both are correct. You still will have a linear relationship: you just think of $x_i^2$ as a variable itself, so there is a linear relationship between $y_i$ and the variable $x_i^2$.