Preheat the oven to 350°F (175°C).
In a saucepan, combine the sugar and water over medium heat. Stir until the sugar dissolves, then stop stirring and allow it to boil until it turns a golden brown color. This should take about 10 minutes.
Immediately pour the caramel into a flan mold or a round baking dish, tilting to coat the bottom evenly. Set aside to cool and harden.
In a skillet, heat the sliced pineapple over medium heat until caramelized, about 5-7 minutes. Remove from heat and let cool slightly.
In a mixing bowl, whisk together the eggs, sweetened condensed milk, evaporated milk, vanilla extract, and salt until well combined.
Gently fold the caramelized pineapple into the egg mixture.
Pour the mixture over the set caramel in the flan mold.
Place the flan mold in a larger baking dish filled with hot water, creating a water bath.
Bake in the preheated oven for about 50-60 minutes, or until the flan is set and a knife inserted in the center comes out clean.
Remove from the oven and let it cool to room temperature. Refrigerate for at least 4 hours or overnight.
To serve, run a knife around the edges of the flan and invert onto a serving plate. Enjoy your caramelized pineapple flan!